avoid using deprecated subs in threads test
[catagits/Catalyst-Runtime.git] / t / optional_threads.t
index c45e66e..3d7dd8a 100644 (file)
@@ -26,15 +26,16 @@ else {
         plan skip_all => 'Needs a Perl with ithreads enabled';
     }
 }
+
 no warnings 'redefine';
-sub request {
-    my $thr = threads->new( 
-        sub { Catalyst::Test::local_request('TestApp',@_) },
-        @_ 
+my $request_code = \&request;
+*request = sub {
+    my $thr = threads->new(
+        sub { $request_code->(@_) },
+        @_
     );
     $thr->join;
-}
+};
 
 # test that running inside a thread works ok
 {
@@ -46,7 +47,7 @@ sub request {
     ];
 
     my $expected = join( ", ", @expected );
-    
+
     ok( my $response = request('http://localhost/action/default'), 'Request' );
     ok( $response->is_success, 'Response Successful 2xx' );
     is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );