From: Marcus Ramberg Date: Sun, 11 May 2008 09:08:43 +0000 (+0000) Subject: test for multiple chained attrs X-Git-Tag: 5.7099_04~78 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=57d7305c41daa31f2e899a8602dfa914bdde2cc3;hp=138c9a7c13f4aad0e240747764b2644757c4316d test for multiple chained attrs --- diff --git a/Changes b/Changes index c33aee5..c67dc21 100644 --- a/Changes +++ b/Changes @@ -10,7 +10,8 @@ - Fix grammar on welcome page (RT #33236) - Fix for Path('0') handling (RT #29334) - Workaround for Win32 and c3_mro.t (RT #26452, tested by Kenichi Ishigaki) - - Fix for encoding query parameters (eden) + - Fix for encoding query parameters (edenc) + - Fix Chained multiple test (t0m) 5.7012 2007-12-16 23:44:00 - Fix uri_for()'s and uri_with()'s handling of multibyte chars diff --git a/lib/Catalyst/DispatchType/Chained.pm b/lib/Catalyst/DispatchType/Chained.pm index 02f4c21..d436983 100644 --- a/lib/Catalyst/DispatchType/Chained.pm +++ b/lib/Catalyst/DispatchType/Chained.pm @@ -208,7 +208,7 @@ sub register { return 0 unless @chained_attr; - if (@chained_attr > 2) { + if (@chained_attr > 1) { Catalyst::Exception->throw( "Multiple Chained attributes not supported registering ${action}" ); diff --git a/t/dead_load_multiple_chained_attributes.t b/t/dead_load_multiple_chained_attributes.t new file mode 100644 index 0000000..7d1ad34 --- /dev/null +++ b/t/dead_load_multiple_chained_attributes.t @@ -0,0 +1,31 @@ +#!perl + +use strict; +use warnings; +use lib 't/lib'; + +use Test::More; + +plan tests => 4; + +use Catalyst::Test 'TestApp'; + +eval q{ + package TestApp::Controller::Action::Chained; + sub should_fail : Chained('/') Chained('foo') Args(0) {} +}; +ok(!$@); + +eval { TestApp->setup_actions; }; +ok($@, 'Multiple chained attributes make action setup fail'); + +eval q{ + package TestApp::Controller::Action::Chained; + no warnings 'redefine'; + sub should_fail {} +}; +ok(!$@); + +eval { TestApp->setup_actions }; +ok(!$@, 'And ok again') or warn $@; +