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;
Returns a C<HTTP::Response> object.
- my $res =request('foo/bar?test=1');
+ my $res = request('foo/bar?test=1');
=cut
else {
$class->require;
-
- if ( $@ ) {
-
- my $error = $UNIVERSAL::require::ERROR;
-
- Catalyst::Exception->throw(
- message => qq/Couldn't load "$class", "$error"/
- );
- }
-
+ die if $@ && $@ !~ /^Can't locate /;
$class->import;
$request = sub { $class->run(@_) };
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
$request->uri->port( $server->port );
$request->uri->path( $server->path . $request->uri->path );
- unless ( $agent ) {
+ unless ($agent) {
$agent = LWP::UserAgent->new(
keep_alive => 1,