]> git.decadent.org.uk Git - maypole.git/blobdiff - t/cgi_maypole.t
Add Vcs-* fields pointing to my public repository
[maypole.git] / t / cgi_maypole.t
index d8a5ccf7b0a219c1d222f7f63f8178f7a774fac0..22a50b37046f09d9744caa8bc56c93a613175bbd 100644 (file)
@@ -14,7 +14,8 @@ my $mock_maypole = new Test::MockModule('CGI::Maypole');
 my $mock_cgi = new Test::MockModule('CGI::Simple');
 $mock_cgi->mock(path_info => sub {
     delete $_[0]->{'.path_info'};
-    goto $mock_cgi->original('path_info')
+    my $orig_path_info = $mock_cgi->original('path_info');
+    goto $orig_path_info;
 });
 
 # run()
@@ -86,7 +87,7 @@ is_deeply($r->params, $r->query, '... query and params are identical');
 can_ok($r => 'send_output');
 SKIP: {
     eval "require IO::CaptureOutput";
-    skip "IO::CaptureOutput not installed", 3 if $@;
+    skip "IO::CaptureOutput not installed", 2 if $@;
     $r->content_type('text/plain');
     $r->document_encoding('iso8859-1');
     $r->output('Hello World!');
@@ -107,11 +108,13 @@ SKIP: {
     };
     diag $@ if $@;
 
-    $compare = join "\cM\cJ", 'Content-length: 12',
-        'X-bender: kiss my shiny metal ass',
+    my $CL = 'Content-length: 12';
+    my $XB = 'X-bender: kiss my shiny metal ass';
+    my $nl = "\cM\cJ";
+    my $re = join $nl, "($CL$nl$XB)|($XB$nl$CL)",
         'Content-Type: text/plain; charset=iso8859-1',
         '', 'Hello World!';
-    is($stdout, $compare, '... prints output, including custom headers');
+    like($stdout, qr/$re/, '... prints output, including custom headers');
 }
 
 # get_template_root()