use Test::Requires in tests
[gitmo/Moose.git] / t / 300_immutable / 011_constructor_is_wrapped.t
index 099f200..e203db3 100644 (file)
@@ -5,10 +5,9 @@ use warnings;
 
 use Test::More;
 
-eval "use Test::Output";
-plan skip_all => "Test::Output is required for this test" if $@;
-
-plan tests => 1;
+use Test::Requires {
+    'Test::Output' => '0.01', # skip all if not installed
+};
 
 {
     package ModdedNew;
@@ -23,9 +22,11 @@ plan tests => 1;
 
     extends 'ModdedNew';
 
-    ::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 (constructor has method modifiers which would be lost if it were inlined)\n",
+        qr/\QNot inlining 'new' for Foo since it has method modifiers which would be lost if it were inlined/,
         'got a warning that Foo may not have an inlined constructor'
     );
 }
+
+done_testing;