7 use lib "$FindBin::Bin/lib";
10 use Catalyst::Test 'TestApp';
11 use Catalyst::Request;
15 plan skip_all => 'set TEST_THREADS to enable this test'
16 unless $ENV{TEST_THREADS};
18 if ( $Config{useithreads} && !$ENV{CATALYST_SERVER} ) {
23 if ( $ENV{CATALYST_SERVER} ) {
24 plan skip_all => 'Using remote server';
27 plan skip_all => 'Needs a Perl with ithreads enabled';
31 no warnings 'redefine';
33 my $thr = threads->new(
34 sub { Catalyst::Test::local_request('TestApp',@_) },
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
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' );