From: André Walker Date: Mon, 15 Aug 2011 17:14:35 +0000 (-0300) Subject: fixing possible problem when ACCEPT_CONTEXT is already defined X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cd5478053ccb62dd27b0a2cbd7265b947dbf0ebc;p=catagits%2FCatalyst-Runtime.git fixing possible problem when ACCEPT_CONTEXT is already defined --- diff --git a/t/lib/TestAppCustomContainer/Role/ACCEPT_CONTEXT.pm b/t/lib/TestAppCustomContainer/Role/ACCEPT_CONTEXT.pm index 340092a..5527eb0 100644 --- a/t/lib/TestAppCustomContainer/Role/ACCEPT_CONTEXT.pm +++ b/t/lib/TestAppCustomContainer/Role/ACCEPT_CONTEXT.pm @@ -12,12 +12,14 @@ has accept_context_called => ( }, ); -sub ACCEPT_CONTEXT { - my ( $self, $ctx, @args ) = @_; +sub ACCEPT_CONTEXT {} + +around ACCEPT_CONTEXT => sub { + my ( $orig, $self, $ctx, @args ) = @_; $self->inc_accept_context_called; - return $self; -} + return $self->$orig() || $self; +}; 1;