8 plan skip_all => 'set TEST_THREADS to enable this test'
9 unless $ENV{TEST_THREADS};
13 use lib "$FindBin::Bin/lib";
14 use Catalyst::Test 'TestApp';
15 use Catalyst::Request;
19 if ( $Config{useithreads} && !$ENV{CATALYST_SERVER} ) {
24 if ( $ENV{CATALYST_SERVER} ) {
25 plan skip_all => 'Using remote server';
28 plan skip_all => 'Needs a Perl with ithreads enabled';
32 no warnings 'redefine';
34 my $thr = threads->new(
35 sub { Catalyst::Test::local_request('TestApp',@_) },
41 # test that running inside a thread works ok
44 TestApp::Controller::Action::Default->begin
45 TestApp::Controller::Action::Default->default
46 TestApp::View::Dump::Request->process
50 my $expected = join( ", ", @expected );
52 ok( my $response = request('http://localhost/action/default'), 'Request' );
53 ok( $response->is_success, 'Response Successful 2xx' );
54 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );