Merge branch 'master' into gsoc_breadboard
[catagits/Catalyst-Runtime.git] / t / lib / TestAppCustomContainer / Role / ACCEPT_CONTEXT.pm
1 package TestAppCustomContainer::Role::ACCEPT_CONTEXT;
2 use Moose::Role;
3 use namespace::autoclean;
4
5 has accept_context_called => (
6     traits  => ['Counter'],
7     isa     => 'Int',
8     is      => 'ro',
9     default => 0,
10     handles => {
11         inc_accept_context_called => 'inc',
12     },
13 );
14
15 sub ACCEPT_CONTEXT {}
16
17 around ACCEPT_CONTEXT => sub {
18     my ( $orig, $self, $ctx, @args ) = @_;
19
20     $self->inc_accept_context_called;
21
22     return $self->$orig() || $self;
23 };
24
25 1;