From: Andy Grundman Date: Fri, 3 Aug 2007 04:57:21 +0000 (+0000) Subject: Fix a few tests to work properly on remote servers X-Git-Tag: 5.7099_04~173 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=048f45ee23401c9f2fbe241639f2687c1e79f990;hp=3b4d12511c59793e85feca1ac1b4a8c2c5f1a6ae Fix a few tests to work properly on remote servers --- diff --git a/t/live_component_controller_action_regexp.t b/t/live_component_controller_action_regexp.t index 559167d..4d4500e 100644 --- a/t/live_component_controller_action_regexp.t +++ b/t/live_component_controller_action_regexp.t @@ -13,6 +13,8 @@ BEGIN { $iters = $ENV{CAT_BENCH_ITERS} || 1; } use Test::More tests => 28*$iters; use Catalyst::Test 'TestApp'; +use Catalyst::Request; + if ( $ENV{CAT_BENCHMARK} ) { require Benchmark; Benchmark::timethis( $iters, \&run_tests ); diff --git a/t/live_component_controller_action_streaming.t b/t/live_component_controller_action_streaming.t index d589d11..68584a1 100644 --- a/t/live_component_controller_action_streaming.t +++ b/t/live_component_controller_action_streaming.t @@ -29,8 +29,17 @@ sub run_tests { ok( my $response = request('http://localhost/streaming'), 'Request' ); ok( $response->is_success, 'Response Successful 2xx' ); is( $response->content_type, 'text/plain', 'Response Content-Type' ); - # XXX: Length should be undef here, but HTTP::Request::AsCGI sets it - is( $response->content_length, 12, 'Response Content-Length' ); + + SKIP: + { + if ( $ENV{CATALYST_SERVER} ) { + skip "Using remote server", 1; + } + + # XXX: Length should be undef here, but HTTP::Request::AsCGI sets it + is( $response->content_length, 12, 'Response Content-Length' ); + } + is( $response->content,, <<'EOF', 'Content is a stream' ); foo bar