Check body, because original_package_name may be a different role
[gitmo/Perl-Critic-Dynamic-Moose.git] / t / DynamicMoose / RequireMakeImmutable.run
CommitLineData
ad350a21 1## name Makes immutable
2## failures 0
3## cut
4
5package Class;
6use Moose;
7
8has attr => (
9 is => 'rw',
10);
11
12__PACKAGE__->meta->make_immutable;
13
14#-----------------------------------------------------------------------------
15
16## name Does not make immutable
17## failures 1
18## cut
19
20package Class;
21use Moose;
22
23has attr => (
24 is => 'rw',
25 builder => '_build_attr',
26);
27
28#-----------------------------------------------------------------------------
29
30## name Does not statically make immutable
31## failures 0
32## cut
33
34for (1 .. 5) {
35 my $class = Class::MOP::Class->create("Foo$_");
36 my $method = join '_', "make", "immutable";
37 $class->$method;
38}
39