[Catalyst-commits] r8794 - in Catalyst-Runtime/5.70/trunk: lib/Catalyst t

andyg at dev.catalyst.perl.org andyg at dev.catalyst.perl.org
Mon Dec 8 21:02:30 GMT 2008


Author: andyg
Date: 2008-12-08 21:02:29 +0000 (Mon, 08 Dec 2008)
New Revision: 8794

Modified:
   Catalyst-Runtime/5.70/trunk/lib/Catalyst/Test.pm
   Catalyst-Runtime/5.70/trunk/t/live_engine_request_uploads.t
   Catalyst-Runtime/5.70/trunk/t/live_engine_request_uri.t
Log:
Backport several fixes from 5.8 needed to get remote tests passing again on 5.7

Modified: Catalyst-Runtime/5.70/trunk/lib/Catalyst/Test.pm
===================================================================
--- Catalyst-Runtime/5.70/trunk/lib/Catalyst/Test.pm	2008-12-08 11:19:02 UTC (rev 8793)
+++ Catalyst-Runtime/5.70/trunk/lib/Catalyst/Test.pm	2008-12-08 21:02:29 UTC (rev 8794)
@@ -187,6 +187,10 @@
             keep_alive   => 1,
             max_redirect => 0,
             timeout      => 60,
+            
+            # work around newer LWP max_redirect 0 bug
+            # http://rt.cpan.org/Ticket/Display.html?id=40260
+            requests_redirectable => [],
         );
 
         $agent->env_proxy;

Modified: Catalyst-Runtime/5.70/trunk/t/live_engine_request_uploads.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/live_engine_request_uploads.t	2008-12-08 11:19:02 UTC (rev 8793)
+++ Catalyst-Runtime/5.70/trunk/t/live_engine_request_uploads.t	2008-12-08 21:02:29 UTC (rev 8794)
@@ -72,7 +72,13 @@
         is( $creq->{parameters}->{ $upload->filename },
             $upload->filename, 'legacy param method ok' );
 
-        ok( !-e $upload->tempname, 'Upload temp file was deleted' );
+        SKIP:
+        {
+            if ( $ENV{CATALYST_SERVER} ) {
+                skip 'Not testing for deleted file on remote server', 1;
+            }
+            ok( !-e $upload->tempname, 'Upload temp file was deleted' );
+        }
     }
 }
 
@@ -128,7 +134,13 @@
         is( $upload->filename, $parameters{filename}, 'Upload filename' );
         is( $upload->size, length( $part->content ), 'Upload Content-Length' );
 
-        ok( !-e $upload->tempname, 'Upload temp file was deleted' );
+        SKIP:
+        {
+            if ( $ENV{CATALYST_SERVER} ) {
+                skip 'Not testing for deleted file on remote server', 1;
+            }
+            ok( !-e $upload->tempname, 'Upload temp file was deleted' );
+        }
     }
 }
 
@@ -245,8 +257,12 @@
 }
 
 # test uploadtmp config var
-
+SKIP:
 {
+    if ( $ENV{CATALYST_SERVER} ) {
+        skip 'Not testing uploadtmp on remote server', 13;
+    }
+    
     my $creq;
 
     my $dir = "$FindBin::Bin/";

Modified: Catalyst-Runtime/5.70/trunk/t/live_engine_request_uri.t
===================================================================
--- Catalyst-Runtime/5.70/trunk/t/live_engine_request_uri.t	2008-12-08 11:19:02 UTC (rev 8793)
+++ Catalyst-Runtime/5.70/trunk/t/live_engine_request_uri.t	2008-12-08 21:02:29 UTC (rev 8794)
@@ -121,27 +121,31 @@
 # more tests with undef - should be ignored
 {
     my $uri = "http://localhost/engine/request/uri/uri_with_undef_only";
+    my ($check) = $uri =~ m{^http://localhost(.+)}; # needed to work with remote servers
     ok( my $response = request($uri), 'Request' );
     ok( $response->is_success, 'Response Successful 2xx' );
-    is( $response->header( 'X-Catalyst-uri-with' ), $uri, 'uri_with ok' );
+    like( $response->header( 'X-Catalyst-uri-with' ), qr/$check$/, 'uri_with ok' );
 
     # try with existing param
     $uri = "$uri?x=1";
+    ($check) = $uri =~ m{^http://localhost(.+)}; # needed to work with remote servers
+    $check =~ s/\?/\\\?/g;
     ok( $response = request($uri), 'Request' );
     ok( $response->is_success, 'Response Successful 2xx' );
-    is( $response->header( 'X-Catalyst-uri-with' ), $uri, 'uri_with ok' );
+    like( $response->header( 'X-Catalyst-uri-with' ), qr/$check$/, 'uri_with ok' );
 }
 
 {
     my $uri = "http://localhost/engine/request/uri/uri_with_undef_ignore";
+    my ($check) = $uri =~ m{^http://localhost(.+)}; # needed to work with remote servers
     ok( my $response = request($uri), 'Request' );
     ok( $response->is_success, 'Response Successful 2xx' );
-    is( $response->header( 'X-Catalyst-uri-with' ), "${uri}?a=1", 'uri_with ok' );
+    like( $response->header( 'X-Catalyst-uri-with' ), qr/$check\?a=1/, 'uri_with ok' );
 
     # remove an existing param
     ok( $response = request("${uri}?b=1"), 'Request' );
     ok( $response->is_success, 'Response Successful 2xx' );
-    is( $response->header( 'X-Catalyst-uri-with' ), "${uri}?a=1", 'uri_with ok' );
+    like( $response->header( 'X-Catalyst-uri-with' ), qr/$check\?a=1/, 'uri_with ok' );
 
     # remove an existing param, leave one, and add a new one
     ok( $response = request("${uri}?b=1&c=1"), 'Request' );




More information about the Catalyst-commits mailing list