Added recursive -r flag to prove example
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Test.pm
index a9f74e5..8157bf3 100644 (file)
@@ -2,6 +2,7 @@ package Catalyst::Test;
 
 use strict;
 
+use Catalyst::Exception;
 use Catalyst::Utils;
 use UNIVERSAL::require;
 
@@ -22,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;
@@ -78,8 +79,15 @@ sub import {
 
     else {
         $class->require;
-        my $error = $UNIVERSAL::require::ERROR;
-        die qq/Couldn't load "$class", "$error"/ if $@;
+        
+        if ( $@ ) {
+            
+            my $error = $UNIVERSAL::require::ERROR;
+            
+            Catalyst::Exception->throw(
+                message => qq/Couldn't load "$class", "$error"/
+            );
+        }
 
         $class->import;
 
@@ -97,7 +105,7 @@ my $agent;
 
 =item remote_request
 
-Do an actual remote rquest using LWP.
+Do an actual remote request using LWP.
 
 =cut