6 plan skip_all => 'set TEST_THREADS to enable this test'
7 unless $ENV{TEST_THREADS};
11 use lib "$FindBin::Bin/lib";
12 use Catalyst::Test 'TestApp';
13 use Catalyst::Request;
17 if ( $Config{useithreads} && !$ENV{CATALYST_SERVER} ) {
22 if ( $ENV{CATALYST_SERVER} ) {
23 plan skip_all => 'Using remote server';
26 plan skip_all => 'Needs a Perl with ithreads enabled';
30 no warnings 'redefine';
31 my $request_code = \&request;
33 my $thr = threads->new(
34 sub { $request_code->(@_) },
40 # test that running inside a thread works ok
43 TestApp::Controller::Action::Default->begin
44 TestApp::Controller::Action::Default->default
45 TestApp::View::Dump::Request->process
46 TestApp::Controller::Root->end
49 my $expected = join( ", ", @expected );
51 ok( my $response = request('http://localhost/action/default'), 'Request' );
52 ok( $response->is_success, 'Response Successful 2xx' );
53 is( $response->header('X-Catalyst-Executed'), $expected, 'Executed actions' );