X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst%2FTest.pm;h=023b8e51c1f7ec58b0f97131ead9c5687e68862a;hp=b7fdb6df9220e7ff505f493bdfc61e360753ed36;hb=68eb5874bcda8eed45d92481248a77533944671a;hpb=a2f2cde95194a17fe2401ae58c92b5494bac599f diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index b7fdb6d..023b8e5 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -23,7 +23,7 @@ Catalyst::Test - Test Catalyst applications get('index.html'); # Run tests against a remote server - CATALYST_SERVER='http://localhost:3000/' prove -l lib/ t/ + CATALYST_SERVER='http://localhost:3000/' prove -r -l lib/ t/ # Tests with inline apps need to use Catalyst::Engine::Test package TestApp; @@ -79,16 +79,6 @@ sub import { else { $class->require; - - if ( $@ ) { - - my $error = $UNIVERSAL::require::ERROR; - - Catalyst::Exception->throw( - message => qq/Couldn't load "$class", "$error"/ - ); - } - $class->import; $request = sub { $class->run(@_) }; @@ -105,17 +95,17 @@ my $agent; =item remote_request -Do an actual remote rquest using LWP. +Do an actual remote request using LWP. =cut sub remote_request { - require LWP::UserAgent; - + require LWP::UserAgent; + my $request = Catalyst::Utils::request( shift(@_) ); - my $server = URI->new( $ENV{CATALYST_SERVER} ); + my $server = URI->new( $ENV{CATALYST_SERVER} ); if ( $server->path =~ m|^(.+)?/$| ) { $server->path("$1"); # need to be quoted @@ -126,7 +116,7 @@ sub remote_request { $request->uri->port( $server->port ); $request->uri->path( $server->path . $request->uri->path ); - unless ( $agent ) { + unless ($agent) { $agent = LWP::UserAgent->new( keep_alive => 1,