From: Tomas Doran Date: Fri, 2 Jan 2009 22:42:14 +0000 (+0000) Subject: Catalyst::View::Mason fixed X-Git-Tag: 5.8000_05~55 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=d258fcb2143b861826a4682d3c04c442f0c1ff9f Catalyst::View::Mason fixed --- diff --git a/Changes b/Changes index ffc36ea..a604f43 100644 --- 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 diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index 9791b24..dcd839a 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -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}; } } diff --git a/t/unit_load_catalyst_test.t b/t/unit_load_catalyst_test.t index 9c9c61c..1b4d863 100644 --- a/t/unit_load_catalyst_test.t +++ b/t/unit_load_catalyst_test.t @@ -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');