aboutsummaryrefslogtreecommitdiff
path: root/t/relativity.t
diff options
context:
space:
mode:
authorAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2014-10-10 20:40:24 -0400
committerAmitai Schlair <schmonz-web-ikiwiki@schmonz.com>2014-10-10 20:40:24 -0400
commitcd9297322a9e909b908320aa8824a7b524396e2f (patch)
tree434a580d3f963d0c29f7236b9acf6e01e334f218 /t/relativity.t
parent7d82570fe09a8f588565873a0da5aaaf95a2d361 (diff)
downloadikiwiki-cd9297322a9e909b908320aa8824a7b524396e2f.tar
ikiwiki-cd9297322a9e909b908320aa8824a7b524396e2f.tar.gz
Extract thoroughly_rebuild(), a slight test change.
I didn't try to parameterize when a test should fail when we can't remove ikiwiki.cgi because there already isn't one. (Hooray, natural language.) Instead, we stop worrying about it and always tolerate ENOENT.
Diffstat (limited to 't/relativity.t')
-rwxr-xr-xt/relativity.t45
1 files changed, 15 insertions, 30 deletions
diff --git a/t/relativity.t b/t/relativity.t
index c3c4fcf1e..c562dccb7 100755
--- a/t/relativity.t
+++ b/t/relativity.t
@@ -87,6 +87,11 @@ EOF
);
}
+sub thoroughly_rebuild {
+ ok(unlink("t/tmp/ikiwiki.cgi") || $!{ENOENT});
+ ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+}
+
#######################################################################
# site 1: a perfectly ordinary ikiwiki
@@ -95,9 +100,7 @@ write_setup_file(
url => "http://example.com/wiki/",
cgiurl => "http://example.com/cgi-bin/ikiwiki.cgi",
);
-
-ok(unlink("t/tmp/ikiwiki.cgi") || $!{ENOENT});
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
my (undef, undef, $mode, undef, undef,
@@ -180,9 +183,7 @@ write_setup_file(
url => "http://example.com/wiki/",
cgiurl => "http://example.com/cgi-bin/ikiwiki.cgi",
);
-
-ok(unlink("t/tmp/ikiwiki.cgi") || $!{ENOENT});
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,
@@ -268,9 +269,7 @@ write_setup_file(
url => "http://static.example.com/",
cgiurl => "http://cgi.example.com/ikiwiki.cgi",
);
-
-ok(unlink("t/tmp/ikiwiki.cgi"));
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,
@@ -343,9 +342,7 @@ write_setup_file(
url => "http://static.example.com/",
cgiurl => "http://cgi.example.com/ikiwiki.cgi",
);
-
-ok(unlink("t/tmp/ikiwiki.cgi"));
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,
@@ -422,9 +419,7 @@ write_setup_file(
url => "https://example.com/wiki/",
cgiurl => "https://example.com/cgi-bin/ikiwiki.cgi",
);
-
-ok(unlink("t/tmp/ikiwiki.cgi"));
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,
@@ -517,9 +512,7 @@ write_setup_file(
url => "http://example.com/wiki/",
cgiurl => "https://example.com/cgi-bin/ikiwiki.cgi",
);
-
-ok(unlink("t/tmp/ikiwiki.cgi"));
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,
@@ -609,9 +602,7 @@ write_setup_file(
url => "http://example.com/wiki/",
cgiurl => "https://example.com/cgi-bin/ikiwiki.cgi",
);
-
-ok(unlink("t/tmp/ikiwiki.cgi"));
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,
@@ -708,9 +699,7 @@ write_setup_file(
cgiurl => "ikiwiki.cgi",
w3mmode => 1,
);
-
-ok(unlink("t/tmp/ikiwiki.cgi"));
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,
@@ -747,9 +736,7 @@ write_setup_file(
cgiurl => "ikiwiki.cgi",
w3mmode => 1,
);
-
-ok(unlink("t/tmp/ikiwiki.cgi"));
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,
@@ -789,9 +776,7 @@ write_setup_file(
cgiurl => "https://example.com/cgi-bin/ikiwiki.cgi",
reverse_proxy => 1,
);
-
-ok(unlink("t/tmp/ikiwiki.cgi"));
-ok(! system("./ikiwiki.out --setup t/tmp/test.setup --rebuild --wrappers"));
+thoroughly_rebuild();
# CGI wrapper should be exactly the requested mode
(undef, undef, $mode, undef, undef,