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