support changes in Catayst::Test introduced in Cataplack
John Napiorkowski [Mon, 1 Aug 2011 14:39:02 +0000 (14:39 +0000)]
CHANGES
lib/Test/WWW/Mechanize/Catalyst.pm

diff --git a/CHANGES b/CHANGES
index a18aea2..e7a2afc 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,9 @@
 Revision history for Perl module Test::WWW::Mechanize::Catalyst:
 
+0.54 Mon Aug 1 10:36 EDT 2011
+     - change to make sure we support changes in Catalyst::Test introduced
+       in the Cataplack port.
+
 0.53 Sun Dec 5 23:03 GMT 2010
      - Fix tests to work with the upcoming psgi based Catalyst release
        as $c->req->header('Host') now more accurately reflects what you
index 96d69a1..eb98a67 100644 (file)
@@ -12,7 +12,7 @@ extends 'Test::WWW::Mechanize', 'Moose::Object';
 
 #use namespace::clean -execept => 'meta';
 
-our $VERSION = '0.53';
+our $VERSION = '0.54';
 our $APP_CLASS;
 my $Test = Test::Builder->new();
 
@@ -148,14 +148,18 @@ sub _do_catalyst_request {
 
       $request->header('Host', $host);
     }
+
     my $res = $self->_check_external_request($request);
     return $res if $res;
 
     my @creds = $self->get_basic_credentials( "Basic", $uri );
     $request->authorization_basic( @creds ) if @creds;
 
-    my $response =Catalyst::Test::local_request($self->{catalyst_app}, $request);
+    require Catalyst;
+    my $response = $Catalyst::VERSION >= 5.89000 ?
+      Catalyst::Test::_local_request($self->{catalyst_app}, $request) :
+        Catalyst::Test::local_request($self->{catalyst_app}, $request);
+
 
     # LWP would normally do this, but we dont get down that far.
     $response->request($request);