From: Tomas Doran Date: Mon, 12 Jan 2009 04:46:50 +0000 (+0000) Subject: Sort out CatalystX::CRUD issues X-Git-Tag: 5.8000_05~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=4348c28b93ab3f849c2cbabcd10ac69d8a6d1614 Sort out CatalystX::CRUD issues --- diff --git a/Changes b/Changes index 647cda5..45bc367 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,10 @@ # This file documents the revision history for Perl extension Catalyst. 5.8000_05 + - Passing request method exported by Catalyst::Test an extra + parameter used to be ignored, but started breaking if the parameter + was not a hash in 5.8000_04. Extra parameter is now ignored if + it isn't a hashref (t0m) - Fix request argumentss getting corrupted if you override the dispatcher and call an action which detaches (for Catalyst::Plugin::Authorization::ACL) (t0m) diff --git a/TODO b/TODO index 6386cb2..ca33efc 100644 --- a/TODO +++ b/TODO @@ -10,13 +10,11 @@ Known issues: and which not, like NEXT does. Log::Log4perl needs to be fixed and the problem should be described in Upgrading.pod. (rafl) - - CatalystX-CRUD-ModelAdapter-DBIC - fail tests against 5.80 (karpet) - - Waiting on new releases: - Catalyst::Plugin::Authentication - 0.100092 - Catalyst::Action::RenderView - 0.08 - Catalyst::Plugin::DebugCookie - 0.999002 + - CatalystX::CRUD - 0.38 Documentation: diff --git a/lib/Catalyst/Test.pm b/lib/Catalyst/Test.pm index dcd839a..65c4354 100644 --- a/lib/Catalyst/Test.pm +++ b/lib/Catalyst/Test.pm @@ -255,6 +255,7 @@ sub remote_request { sub _customize_request { my $request = shift; my $opts = pop(@_) || {}; + $opts = {} unless ref($opts) eq 'HASH'; if ( my $host = exists $opts->{host} ? $opts->{host} : $default_host ) { $request->header( 'Host' => $host ); } diff --git a/t/unit_load_catalyst_test.t b/t/unit_load_catalyst_test.t index 1b4d863..67a1171 100644 --- a/t/unit_load_catalyst_test.t +++ b/t/unit_load_catalyst_test.t @@ -7,8 +7,9 @@ use Test::More; use FindBin qw/$Bin/; use lib "$Bin/lib"; use Catalyst::Utils; +use HTTP::Request::Common; -plan tests => 9; +plan tests => 11; use_ok('Catalyst::Test'); @@ -18,6 +19,8 @@ isnt( $@, "", "get returns an error message with no app specified"); eval "request('http://localhost')"; isnt( $@, "", "request returns an error message with no app specified"); +# FIXME - These vhosts in tests tests should be somewhere else... + sub customize { Catalyst::Test::_customize_request(@_) } { @@ -55,3 +58,11 @@ sub customize { Catalyst::Test::_customize_request(@_) } # Back compat test, extra args used to be ignored, now a hashref of options. use_ok('Catalyst::Test', 'TestApp', 'foobar'); + +# Back compat test, ensure that request ignores anything which isn't a hash. +lives_ok { + request(GET('/dummy'), 'foo'); +} 'scalar additional param to request method ignored'; +lives_ok { + request(GET('/dummy'), []); +} 'array additional param to request method ignored';