6 use Test::More tests => 6;
15 return bless { not_moose => 1 }, $class;
26 sub { Foo->meta->make_immutable },
27 "Not inlining 'new' for Foo since it is not inheriting the default Moose::Object::new\nIf you are certain you don't need to inline your constructor, specify inline_constructor => 0 in your call to Foo->meta->make_immutable\n",
28 'got a warning that Foo may not have an inlined constructor'
33 Foo->meta->find_method_by_name('new')->body,
35 'Foo->new is inherited from NotMoose'
45 sub { Bar->meta->make_immutable( replace_constructor => 1 ) },
47 'no warning when replace_constructor is true'
52 Bar->meta->find_method_by_name('new')->package_name,
54 'Bar->new is inlined, and not inherited from NotMoose'
61 Baz->meta->make_immutable;
71 sub { Quux->meta->make_immutable },
73 'no warning when inheriting from a class that has already made itself immutable'
78 package My::Constructor;
79 use base 'Moose::Meta::Method::Constructor';
86 CustomCons->meta->make_immutable( constructor_class => 'My::Constructor' );
96 sub { Subclass->meta->make_immutable },
98 'no warning when inheriting from a class that has already made itself immutable'