X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FCatalyst%2FTest.pm;h=3962927517adbaea405ee0e4e207d6655298046c;hb=d5c1270360c155009fa138b6f0630044304f3c86;hp=821b6e314aeaa51e2b2f627bd3eb8450c5ad5cf8;hpb=65791fc58356d0e6891ff3fdbc0dc6ed92698ee6;p=catagits%2FCatalyst-Runtime.git diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index 821b6e3..3962927 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -5,7 +5,6 @@ use warnings; use Test::More (); use Plack::Test; -use Plack::Middleware::OverrideEnv; use Catalyst::Exception; use Catalyst::Utils; use Class::MOP; @@ -28,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, @_ ) }; } @@ -108,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}; @@ -231,12 +236,8 @@ sub local_request { my $ret; test_psgi - app => Plack::Middleware::OverrideEnv->wrap( - $app, env_override => \%extra_env, - ), - client => sub { - $ret = shift->($request); - }; + app => sub { $app->({ %{ $_[0] }, %extra_env }) }, + client => sub { $ret = shift->($request) }; return $ret; }