X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fmulti_content_type.t;h=f0bf615d141fb07512c374a10e435ec9e18be73b;hb=6435acdcab63d866a5eba6d434b356cadba89588;hp=521f46340555cfe8abfb7ce31a4e0599668ed10d;hpb=97ae89ab316de422a55b3b3252ab4dbabfcdbdcd;p=catagits%2FTest-WWW-Mechanize-Catalyst.git diff --git a/t/multi_content_type.t b/t/multi_content_type.t index 521f463..f0bf615 100644 --- a/t/multi_content_type.t +++ b/t/multi_content_type.t @@ -7,10 +7,9 @@ my $PORT; BEGIN { $PORT = $ENV{TWMC_TEST_PORT} || 7357; - $ENV{CATALYST_SERVER} ||= "http://localhost:$PORT"; } -use Test::More tests => 8; +use Test::More tests => 9; use Test::Exception; BEGIN { @@ -27,7 +26,9 @@ BEGIN { $SIG{INT} = sub { warn "INT:$$"; exit }; use_ok 'ExternalCatty'; -my $pid = ExternalCatty->background($PORT); +my $pid; +($pid, $PORT) = ExternalCatty->background($PORT); +$ENV{CATALYST_SERVER} ||= "http://localhost:$PORT"; use Test::WWW::Mechanize::Catalyst; my $m = Test::WWW::Mechanize::Catalyst->new; @@ -42,7 +43,7 @@ TRY_CONNECT: { } SKIP: { - skip $skip, 7 if $skip; + skip $skip, 8 if $skip; lives_ok { $m->get_ok( '/', 'Get a multi Content-Type response' ) } 'Survive to a multi Content-Type sting'; @@ -53,6 +54,10 @@ SKIP: { # Test a redirect with a remote server now too. $m->get_ok( '/hello' ); is($m->uri, "$ENV{CATALYST_SERVER}/"); + + $m->get_ok( '/host' ); + $m->content_contains('Host: localhost:$PORT') or diag $m->content; + } END {