summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoey Hess <joey@kitenet.net>2010-07-16 16:05:59 -0400
committerJoey Hess <joey@kitenet.net>2010-07-16 16:07:51 -0400
commit936dc6fc8ed7bbb05ad858c04894e317924fef8f (patch)
treed46e0aa0e1a8a230bc2085fa06606bc7250279be
parent7a04e2d4161d2f23f92bc87e23349354c06e820b (diff)
add test of file replace
-rwxr-xr-xt/replace.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/replace.t b/t/replace.t
new file mode 100755
index 000000000..7d91f772f
--- /dev/null
+++ b/t/replace.t
@@ -0,0 +1,34 @@
+#!/usr/bin/perl
+use warnings;
+use strict;
+use Test::More 'no_plan';
+
+# setup
+my $srcdir="t/tmp/src";
+my $destdir="t/tmp/dest";
+ok(! system("make -s ikiwiki.out"));
+ok(! system("mkdir -p $srcdir"));
+
+# runs ikiwiki to build test site
+sub runiki {
+ ok(! system("perl -I. ./ikiwiki.out -plugin html -underlaydir=underlays/basewiki -set underlaydirbase=underlays -templatedir=templates $srcdir $destdir @_"));
+}
+sub refreshiki {
+ runiki();
+}
+sub setupiki {
+ ok(! system("rm -rf $srcdir/.ikiwiki $destdir"));
+ runiki("--rebuild");
+}
+
+# At one point, changing the extension of the source file of a page caused
+# ikiwiki to fail.
+ok(! system("touch $srcdir/foo.mdwn"));
+setupiki();
+ok(! system("mv $srcdir/foo.mdwn $srcdir/foo.html"));
+refreshiki();
+
+# Changing a non-page file into a page could also cause ikiwiki to fail.
+
+# cleanup
+ok(! system("rm -rf t/tmp"));