Tests showing we are not immutable at the end of the file, but we are as soon as...
[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