diff options
Diffstat (limited to 't')
-rw-r--r-- | t/basic.t | 27 | ||||
-rw-r--r-- | t/htdocs/foot.html | 2 | ||||
-rw-r--r-- | t/htdocs/head.html | 2 |
3 files changed, 15 insertions, 16 deletions
@@ -13,18 +13,6 @@ my $head; # expected page header my $foot; # expected page footer my @body; # sections of page body -mkdir 't/htdocs/subdir' if ! -d 't/htdocs/subdir'; - -# Read contents of header and footer - -open my $h, '<', 't/htdocs/head.html' - or die "Could not open < t/htdocs/head.html: $!"; -open my $f, '<', 't/htdocs/foot.html' - or die "Could not open < t/htdocs/foot.html: $!"; -$head = do { local $/; <$h> }; -$foot = do { local $/; <$f> }; -close $h; close $f; - # Helper for replacing file contents sub overwrite { @@ -36,6 +24,18 @@ sub overwrite { # Run tests +mkdir 't/htdocs/subdir' if ! -d 't/htdocs/subdir'; + +$head = <<HEAD; +This is a test header. +HEAD +overwrite 't/htdocs/head.html', $head; + +$foot = <<HEAD; +This is a test footer. +HEAD +overwrite 't/htdocs/foot.html', $foot; + overwrite 't/htdocs/.htaccess', <<CONF; Inject head.html foot.html CONF @@ -94,6 +94,9 @@ ok GET_BODY('/test.html'), "${body[0]}$head", 'only footer'; unlink 't/htdocs/.htaccess'; +unlink 't/htdocs/head.html'; +unlink 't/htdocs/foot.html'; unlink 't/htdocs/test.html'; unlink 't/htdocs/subdir/.htaccess'; unlink 't/htdocs/subdir/test.html'; +rmdir 't/htdocs/subdir'; diff --git a/t/htdocs/foot.html b/t/htdocs/foot.html deleted file mode 100644 index 77ef8be..0000000 --- a/t/htdocs/foot.html +++ /dev/null @@ -1,2 +0,0 @@ -<hr/> -<p>Copyright © Site Owner</p> diff --git a/t/htdocs/head.html b/t/htdocs/head.html deleted file mode 100644 index b4abf3f..0000000 --- a/t/htdocs/head.html +++ /dev/null @@ -1,2 +0,0 @@ -<h1>Site Header</h1> -<hr/> |