use Test::More;
-eval "use Test::Output";
-plan skip_all => "Test::Output is required for this test" if $@;
-
-plan tests => 6;
+use Test::Requires {
+ 'Test::Output' => '0.01', # skip all if not installed
+};
{
package NotMoose;
extends 'NotMoose';
- ::stderr_is(
+ ::stderr_like(
sub { Foo->meta->make_immutable },
- "Not inlining a constructor for Foo since it is not inheriting the default Moose::Object constructor\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",
+ 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/,
'got a warning that Foo may not have an inlined constructor'
);
}
'no warning when inheriting from a class that has already made itself immutable'
);
}
+
+done_testing;