FailIfACCEPT_CONTEXTCalled role
André Walker [Mon, 15 Aug 2011 15:03:37 +0000 (12:03 -0300)]
t/lib/TestAppCustomContainer/Model/SingletonLifeCycle.pm
t/lib/TestAppCustomContainer/Role/FailIfACCEPT_CONTEXTCalled.pm [new file with mode: 0644]

index 4a6822e..c62afea 100644 (file)
@@ -2,7 +2,7 @@ package TestAppCustomContainer::Model::SingletonLifeCycle;
 use Moose;
 extends 'Catalyst::Model';
 with 'TestAppCustomContainer::Role::HoldsFoo',
-     'TestAppCustomContainer::Role::ACCEPT_CONTEXT';
+     'TestAppCustomContainer::Role::FailIfACCEPT_CONTEXTCalled';
 
 __PACKAGE__->meta->make_immutable;
 
diff --git a/t/lib/TestAppCustomContainer/Role/FailIfACCEPT_CONTEXTCalled.pm b/t/lib/TestAppCustomContainer/Role/FailIfACCEPT_CONTEXTCalled.pm
new file mode 100644 (file)
index 0000000..975d2d1
--- /dev/null
@@ -0,0 +1,11 @@
+package TestAppCustomContainer::Role::FailIfACCEPT_CONTEXTCalled;
+use Moose::Role;
+use Test::More;
+
+sub ACCEPT_CONTEXT {}
+before ACCEPT_CONTEXT => sub {
+    my ($self, $ctx, @args) = @_;
+    fail("ACCEPT_CONTEXT called for $self");
+};
+
+1;