[Catalyst-commits] r12564 - Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst

rafl at dev.catalyst.perl.org rafl at dev.catalyst.perl.org
Sat Jan 9 17:48:51 GMT 2010


Author: rafl
Date: 2010-01-09 17:48:51 +0000 (Sat, 09 Jan 2010)
New Revision: 12564

Modified:
   Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Test.pm
Log:
Delay erroring out on wrong usage of Catalyst::Test.

We should probably deprecate

  use Catalyst::Test;

(without an app name) in favour of

  use Catalyst::Test ();

Modified: Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Test.pm
===================================================================
--- Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Test.pm	2010-01-09 17:48:45 UTC (rev 12563)
+++ Catalyst-Runtime/5.80/branches/psgi/lib/Catalyst/Test.pm	2010-01-09 17:48:51 UTC (rev 12564)
@@ -17,12 +17,10 @@
     my $request;
     my $class = $args->{class};
 
-    if (!$class) {
-        croak "Must specify a test app: use Catalyst::Test 'TestApp'";
-    }
-
     if ( $ENV{CATALYST_SERVER} ) {
         $request = sub { remote_request(@_) };
+    } elsif (!$class) {
+        $request = sub { croak "Must specify a test app: use Catalyst::Test 'TestApp'"; }
     } else {
         unless (Class::MOP::is_class_loaded($class)) {
             Class::MOP::load_class($class);




More information about the Catalyst-commits mailing list