From: Tomas Doran Date: Sun, 13 May 2012 20:17:16 +0000 (+0000) Subject: Fix starting the server, test still fucked however X-Git-Tag: 0.58~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FTest-WWW-Mechanize-Catalyst.git;a=commitdiff_plain;h=71896b6e2ad0faf686bfab695a70b89ef15aac4f Fix starting the server, test still fucked however --- diff --git a/Makefile.PL b/Makefile.PL index 20019eb..1db4960 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -8,7 +8,7 @@ name 'Test-WWW-Mechanize-Catalyst'; perl_version '5.008004'; all_from 'lib/Test/WWW/Mechanize/Catalyst.pm'; -requires 'Catalyst' => '5.00'; +requires 'Catalyst' => '5.90'; requires 'LWP' => '5.816'; requires 'Test::WWW::Mechanize' => '1.14'; requires 'WWW::Mechanize' => '1.54'; diff --git a/t/lib/ExternalCatty.pm b/t/lib/ExternalCatty.pm index 9924cab..27bce2e 100644 --- a/t/lib/ExternalCatty.pm +++ b/t/lib/ExternalCatty.pm @@ -2,11 +2,11 @@ package ExternalCatty; use strict; use warnings; use Catalyst; +use Catalyst::ScriptRunner; use IO::Socket::INET; __PACKAGE__->config( name => 'ExternalCatty' ); __PACKAGE__->setup; -__PACKAGE__->setup_engine('HTTP'); sub MAX_PORT_TRIES() { 5 } @@ -24,8 +24,8 @@ sub background { require POSIX; POSIX::setsid() or die "Can't start a new session: $!"; } - - return($self->run($port), $port); + local @ARGV = ('-p', $port); + Catalyst::ScriptRunner->run(__PACKAGE__, 'Server'); } sub assert_or_find_available_port { diff --git a/t/multi_content_type.t b/t/multi_content_type.t index 7cd92d3..097dce9 100644 --- a/t/multi_content_type.t +++ b/t/multi_content_type.t @@ -9,7 +9,7 @@ BEGIN { $PORT = $ENV{TWMC_TEST_PORT} || 7357; } -use Test::More tests => 9; +use Test::More; use Test::Exception; BEGIN { @@ -33,6 +33,9 @@ $ENV{CATALYST_SERVER} ||= "http://localhost:$PORT"; use Test::WWW::Mechanize::Catalyst; my $m = Test::WWW::Mechanize::Catalyst->new; +# Yeah, sorry - wait for the forked process to spin up... +sleep 10; + my $skip = 0; TRY_CONNECT: { eval { $m->get('/') }; @@ -67,5 +70,7 @@ END { } } +done_testing; + 1;