X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fmulti_content_type.t;fp=t%2Fmulti_content_type.t;h=081a47ec4d76ccc9635bf5d84a113c6cf86c4b31;hb=cfd812d6df038fa098c69af4e8a80e0342e7b1ce;hp=6fbdaa4652269daba9b87dcb1457684f4c09048f;hpb=ab0b00e34c84030a407adce9be1a94c66b946fa5;p=catagits%2FTest-WWW-Mechanize-Catalyst.git diff --git a/t/multi_content_type.t b/t/multi_content_type.t index 6fbdaa4..081a47e 100644 --- a/t/multi_content_type.t +++ b/t/multi_content_type.t @@ -32,15 +32,27 @@ my $pid = ExternalCatty->background($PORT); use Test::WWW::Mechanize::Catalyst; my $m = Test::WWW::Mechanize::Catalyst->new; -lives_ok { $m->get_ok( '/', 'Get a multi Content-Type response' ) } -'Survive to a multi Content-Type sting'; +my $skip = 0; +TRY_CONNECT: { + eval { $m->get('/') }; -is( $m->ct, 'text/html', 'Multi Content-Type Content-Type' ); -$m->title_is( 'Root', 'Multi Content-Type title' ); -$m->content_contains( "Hello, test \x{263A}!", 'Multi Content-Type body' ); + if ($@ || $m->content =~ /\(connect: Connection refused\)/) { + $skip = $@ || $m->content; + } +} + +SKIP: { + skip $skip, 5 if $skip; + lives_ok { $m->get_ok( '/', 'Get a multi Content-Type response' ) } + 'Survive to a multi Content-Type sting'; + + is( $m->ct, 'text/html', 'Multi Content-Type Content-Type' ); + $m->title_is( 'Root', 'Multi Content-Type title' ); + $m->content_contains( "Hello, test \x{263A}!", 'Multi Content-Type body' ); +} END { - if ( $pid > 0 ) { + if ( $pid && $pid > 0 ) { kill 9, $pid; } }