36d8e16784bdae6b80ad17d9298e7debbed552f5
[catagits/Catalyst-Runtime.git] / t / lib / TestAppPluginWithConstructor.pm
1 # See t/plugin_new_method_backcompat.t
2 package TestAppPluginWithConstructor;
3 use Test::More;
4 use Test::Exception;
5 use Catalyst qw/+TestPluginWithConstructor/;
6 use Moose;
7 BEGIN { extends qw/Catalyst Catalyst::Controller/ } # Ewww, FIXME.
8
9 sub foo : Local {
10     my ($self, $c) = @_;
11     $c->res->body('foo');
12 }
13
14 __PACKAGE__->setup;
15 our $MODIFIER_FIRED = 0;
16
17 lives_ok {
18     before 'dispatch' => sub { $MODIFIER_FIRED = 1 }
19 } 'Can apply method modifier';
20 no Moose;
21
22 our $IS_IMMUTABLE_YET = __PACKAGE__->meta->is_immutable;
23 ok !$IS_IMMUTABLE_YET, 'I am not immutable yet';
24
25 1;
26