Changes for next version
[gitmo/MooseX-Singleton.git] / t / 006-cooperative.t
index 4a52662..4d6d832 100644 (file)
@@ -3,12 +3,10 @@ use warnings;
 
 use Test::More;
 
-BEGIN {
-    eval "require MooseX::StrictConstructor; use Test::Exception;";
-    plan skip_all =>
-        'This test requires MooseX::StrictConstructor and Test::Exception'
-        if $@;
-}
+use Test::Requires {
+    'MooseX::StrictConstructor' => 0.16,
+    'Test::Fatal' => 0.001,
+};
 
 {
     package MySingleton;
@@ -19,9 +17,9 @@ BEGIN {
     has 'attrib' => ( is => 'rw' );
 }
 
-throws_ok {
+like( exception {
     MySingleton->new( bad_name => 42 );
-}
-qr/Found unknown attribute/, 'singleton class also has a strict constructor';
+},
+qr/Found unknown attribute/, 'singleton class also has a strict constructor');
 
 done_testing;