From: Toby Corkindale Date: Wed, 7 Sep 2011 08:05:37 +0000 (+1000) Subject: Fixes to work with Catalyst 5.9 engine. X-Git-Tag: 0.07~7 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FTest-WWW-Selenium-Catalyst.git;a=commitdiff_plain;h=15cb5c91ada6c4b5aacac8f1db24fd29ad29de06 Fixes to work with Catalyst 5.9 engine. Almost certainly breaks compatibility with 5.7 and 5.8 though, sorry :( --- diff --git a/lib/Test/WWW/Selenium/Catalyst.pm b/lib/Test/WWW/Selenium/Catalyst.pm index 8b4ed34..c6379e3 100644 --- a/lib/Test/WWW/Selenium/Catalyst.pm +++ b/lib/Test/WWW/Selenium/Catalyst.pm @@ -7,6 +7,7 @@ use Alien::SeleniumRC; use Test::WWW::Selenium; use Test::More; use Catalyst::Utils; +use Catalyst::EngineLoader; BEGIN { $ENV{CATALYST_ENGINE} ||= 'HTTP'; } @@ -216,8 +217,16 @@ sub start { diag("Catalyst server $$ going down (TERM)") if $DEBUG; exit 0; }; - diag("Catalyst server running in $$") if $DEBUG; - $app->run($port, 'localhost'); + diag("Catalyst server running in pid $$ with port $port") if $DEBUG; + my $loader = Catalyst::EngineLoader->new(application_name => $app); + my $server = $loader->auto(port => $port, host => 'localhost', + server_ready => sub { + diag("Server started on port $port") if $DEBUG; + }, + ); + $app->run($port, 'localhost', $server); + + diag("Process $$ (catalyst server) exiting.") if $DEBUG; exit 1; } $uri = 'http://localhost:' . $port;