From: Marcus Ramberg Date: Sun, 30 Nov 2008 00:29:57 +0000 (+0000) Subject: Fix ACCEPT_CONTEXT on MyApp X-Git-Tag: 5.8000_03~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=8abaac85ce28cc1e3fa5d8f56c7b1f71213ac5b3;hp=3fc0073c71b2590168ab0503100b475cb201a524 Fix ACCEPT_CONTEXT on MyApp --- diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index 66477ec..ae0cc92 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -526,7 +526,7 @@ sub _comp_names { sub _filter_component { my ( $c, $comp, @args ) = @_; - if ( Scalar::Util::blessed($c) && eval { $comp->can('ACCEPT_CONTEXT'); } ) { + if ( eval { $comp->can('ACCEPT_CONTEXT'); } ) { return $comp->ACCEPT_CONTEXT( $c, @args ); } diff --git a/t/unit_core_mvc.t b/t/unit_core_mvc.t index 6d1c7fc..0953e2c 100644 --- a/t/unit_core_mvc.t +++ b/t/unit_core_mvc.t @@ -1,4 +1,4 @@ -use Test::More tests => 46; +use Test::More tests => 45; use strict; use warnings; @@ -160,7 +160,7 @@ is ( MyApp->model , 'MyApp::Model::M', 'default_model in class method ok'); # test accept-context with class rather than instance MyApp->model('M', qw/foo bar/); - is_deeply($args, [qw/foo bar/], '$c->model args passed to ACCEPT_CONTEXT ok'); + is_deeply($args, [qw/foo bar/], 'MyApp->model args passed to ACCEPT_CONTEXT ok'); $c->model('M', qw/foo bar/); @@ -173,7 +173,5 @@ is ( MyApp->model , 'MyApp::Model::M', 'default_model in class method ok'); $c->view('::View::V', qw/foo3 bar3/); is_deeply($args, [qw/foo3 bar3/], 'args passed to ACCEPT_CONTEXT ok'); - undef $args; - MyApp->model('M', qw/foo bar/); - is($args, undef, 'MyApp->model does not invoke ACCEPT_CONTEXT'); + }