fixing possible problem when ACCEPT_CONTEXT is already defined
André Walker [Mon, 15 Aug 2011 17:14:35 +0000 (14:14 -0300)]
t/lib/TestAppCustomContainer/Role/ACCEPT_CONTEXT.pm

index 340092a..5527eb0 100644 (file)
@@ -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;