plan tests => 2;
}
-stderr_is( sub { package main; eval 'use Moose' },
- "Moose does not export its sugar to the 'main' package.\n",
- 'Moose warns when loaded from the main package' );
+stderr_like( sub { package main; eval 'use Moose' },
+ qr/\QMoose does not export its sugar to the 'main' package/,
+ 'Moose warns when loaded from the main package' );
-stderr_is( sub { package main; eval 'use Moose::Role' },
- "Moose::Role does not export its sugar to the 'main' package.\n",
- 'Moose::Role warns when loaded from the main package' );
+stderr_like( sub { package main; eval 'use Moose::Role' },
+ qr/\QMoose::Role does not export its sugar to the 'main' package/,
+ 'Moose::Role warns when loaded from the main package' );
extends 'ModdedNew';
- ::stderr_is(
+ ::stderr_like(
sub { Foo->meta->make_immutable },
- "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 ('new' has method modifiers which would be lost if it were inlined)\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\E\s+\Q ('new' has method modifiers which would be lost if it were inlined)/,
'got a warning that Foo may not have an inlined constructor'
);
}