Merge branch 'master' into psgi
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Test.pm
index 191c637..3962927 100644 (file)
@@ -27,7 +27,7 @@ my $build_exports = sub {
         }
         $class->import;
 
-        my $app = $class->engine->_build_psgi_app($class);
+        my $app = $class->psgi_app;
 
         $request = sub { local_request( $app, @_ ) };
     }
@@ -107,6 +107,12 @@ our $default_host;
 
     sub import {
         my ($self, $class, $opts) = @_;
+        Carp::carp(
+qq{Importing Catalyst::Test without an application name is deprecated:\n
+Instead of saying: use Catalyst::Test;
+say: use Catalyst::Test (); # If you don't want to import a test app right now.
+or say: use Catalyst::Test 'MyApp'; # If you do want to import a test app.\n\n})
+        unless $class;
         $import->($self, '-all' => { class => $class });
         $opts = {} unless ref $opts eq 'HASH';
         $default_host = $opts->{default_host} if exists $opts->{default_host};