8 eval "use Test::Output;";
9 plan skip_all => "Test::Output is required for this test" if $@;
19 return bless { not_moose => 1 }, $class;
30 sub { Foo->meta->make_immutable },
31 qr/\QNot inlining 'new' for Foo since it is not inheriting the default Moose::Object::new\E\s+\QIf you are certain you don't need to inline your constructor, specify inline_constructor => 0 in your call to Foo->meta->make_immutable/,
32 'got a warning that Foo may not have an inlined constructor'
37 Foo->meta->find_method_by_name('new')->body,
39 'Foo->new is inherited from NotMoose'
49 sub { Bar->meta->make_immutable( replace_constructor => 1 ) },
51 'no warning when replace_constructor is true'
56 Bar->meta->find_method_by_name('new')->package_name,
58 'Bar->new is inlined, and not inherited from NotMoose'
65 Baz->meta->make_immutable;
75 sub { Quux->meta->make_immutable },
77 'no warning when inheriting from a class that has already made itself immutable'
82 package My::Constructor;
83 use base 'Moose::Meta::Method::Constructor';
90 CustomCons->meta->make_immutable( constructor_class => 'My::Constructor' );
100 sub { Subclass->meta->make_immutable },
102 'no warning when inheriting from a class that has already made itself immutable'