more convert to using Test::Requires
[gitmo/MooseX-Singleton.git] / t / 006-cooperative.t
index ccc2695..fdae12f 100644 (file)
@@ -3,14 +3,10 @@ use warnings;
 
 use Test::More;
 
-BEGIN {
-    eval "require MooseX::StrictConstructor; use Test::Exception; 1;";
-    plan skip_all =>
-        'This test requires MooseX::StrictConstructor and Test::Exception'
-        if $@;
-}
-
-plan 'no_plan';
+use Test::Requires {
+   'MooseX::StrictConstructor' => 0.01, # skip all if not installed
+   'Test::Exception' => 0.01,
+};
 
 {
     package MySingleton;
@@ -25,3 +21,5 @@ throws_ok {
     MySingleton->new( bad_name => 42 );
 }
 qr/Found unknown attribute/, 'singleton class also has a strict constructor';
+
+done_testing;