X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=t%2Funit_core_component.t;h=368f163c46664c028ab83a49f29f375fd3b4b682;hp=250960a1fca16c3d858391651700aba227dad668;hb=ae29b412955743885e80350085167b54b69672da;hpb=e16a6c4e6c4d49e73b5286b3186616af14f3f554 diff --git a/t/unit_core_component.t b/t/unit_core_component.t index 250960a..368f163 100644 --- a/t/unit_core_component.t +++ b/t/unit_core_component.t @@ -73,16 +73,20 @@ is_deeply([ MyApp->comp('Foo') ], \@complist, 'Fallthrough return ok'); { my $args; - no warnings; - *MyApp::M::Model::ACCEPT_CONTEXT = sub { my ($self, $c, @args) = @_; $args= \@args}; + { + no warnings 'once'; + *MyApp::M::Model::ACCEPT_CONTEXT = sub { my ($self, $c, @args) = @_; $args= \@args}; + } + + my $c = bless {}, 'MyApp'; - MyApp->component('MyApp::M::Model', qw/foo bar/); + $c->component('MyApp::M::Model', qw/foo bar/); is_deeply($args, [qw/foo bar/], 'args passed to ACCEPT_CONTEXT ok'); - MyApp->component('M::Model', qw/foo2 bar2/); + $c->component('M::Model', qw/foo2 bar2/); is_deeply($args, [qw/foo2 bar2/], 'args passed to ACCEPT_CONTEXT ok'); - MyApp->component('Mode', qw/foo3 bar3/); + $c->component('Mode', qw/foo3 bar3/); is_deeply($args, [qw/foo3 bar3/], 'args passed to ACCEPT_CONTEXT ok'); }