Catalyst::View::Mason fixed
Tomas Doran [Fri, 2 Jan 2009 22:42:14 +0000 (22:42 +0000)]
Changes
lib/Catalyst/Test.pm
t/unit_load_catalyst_test.t

diff --git a/Changes b/Changes
index ffc36ea..a604f43 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,7 @@
 # This file documents the revision history for Perl extension Catalyst.
 
+        - Fix calling use Catalyst::Test 'MyApp' 'foo' which used to work,
+          but stopped as the 2nd parameter can be an options hash now (t0m)
         - Bump Moose dependency to fix make_immutable bug (t0m)
         - Use compile time extends in Catalyst::Controller (t0m)
         - Make Catalyst::Request::uploads attribute non-lazy, to fix
index 9791b24..dcd839a 100644 (file)
@@ -70,7 +70,7 @@ our $default_host;
     sub import {
         my ($self, $class, $opts) = @_;
         $import->($self, '-all' => { class => $class });
-        $opts ||= {};
+        $opts = {} unless ref $opts eq 'HASH';
         $default_host = $opts->{default_host} if exists $opts->{default_host};
     }
 }
index 9c9c61c..1b4d863 100644 (file)
@@ -4,9 +4,11 @@ use strict;
 use warnings;
 
 use Test::More;
+use FindBin qw/$Bin/;
+use lib "$Bin/lib";
 use Catalyst::Utils;
 
-plan tests => 8;
+plan tests => 9;
 
 use_ok('Catalyst::Test');
 
@@ -50,3 +52,6 @@ sub customize { Catalyst::Test::_customize_request(@_) }
     customize( $req, { host => '' } );
     is( $req->header('Host'), undef, 'default value can be temporarily cleared via opts hash' );
 }
+
+# Back compat test, extra args used to be ignored, now a hashref of options.
+use_ok('Catalyst::Test', 'TestApp', 'foobar');