use Test::Requires in tests
[gitmo/Moose.git] / t / 030_roles / 019_build.t
index cd973cd..faa5cbc 100644 (file)
@@ -2,11 +2,10 @@
 use strict;
 use warnings;
 use Test::More;
-BEGIN {
-    eval "use Test::Output;";
-    plan skip_all => "Test::Output is required for this test" if $@;
-    plan tests => 8;
-}
+
+use Test::Requires {
+    'Test::Output' => '0.01', # skip all if not installed
+};
 
 # this test script ensures that my idiom of:
 # role: sub BUILD, after BUILD
@@ -40,7 +39,7 @@ do {
     use Moose;
 
     ::stderr_is {
-        with 'TestRole' => { excludes => 'BUILD' };
+        with 'TestRole' => { -excludes => 'BUILD' };
     } '';
 
     sub BUILD { push @CALLS, 'ExplicitClassWithBUILD::BUILD' }
@@ -78,3 +77,4 @@ do {
     }
 }
 
+done_testing;