Convert to Test::Fatal and tidy resulting code
[gitmo/MooseX-Params-Validate.git] / t / 003_nocache_flag.t
index a1ae689..5ef7bab 100644 (file)
@@ -4,7 +4,7 @@ use strict;
 use warnings;
 
 use Test::More;
-use Test::Exception;
+use Test::Fatal;
 
 {
     package Foo;
@@ -21,19 +21,28 @@ use Test::Exception;
 my $foo = Foo->new;
 isa_ok( $foo, 'Foo' );
 
-lives_ok {
-    $foo->bar( [ baz => 1 ], { baz => { isa => 'Int' } } );
-}
-'... successfully applied the parameter validation';
-
-lives_ok {
-    $foo->bar( [ baz => [ 1, 2, 3 ] ], { baz => { isa => 'ArrayRef' } } );
-}
-'... successfully applied the parameter validation (look mah no cache)';
-
-lives_ok {
-    $foo->bar( [ baz => { one => 1 } ], { baz => { isa => 'HashRef' } } );
-}
-'... successfully applied the parameter validation (look mah no cache) (just checkin)';
+is(
+    exception {
+        $foo->bar( [ baz => 1 ], { baz => { isa => 'Int' } } );
+    },
+    undef,
+    '... successfully applied the parameter validation'
+);
+
+is(
+    exception {
+        $foo->bar( [ baz => [ 1, 2, 3 ] ], { baz => { isa => 'ArrayRef' } } );
+    },
+    undef,
+    '... successfully applied the parameter validation (look mah no cache)'
+);
+
+is(
+    exception {
+        $foo->bar( [ baz => { one => 1 } ], { baz => { isa => 'HashRef' } } );
+    },
+    undef,
+    '... successfully applied the parameter validation (look mah no cache) (just checkin)'
+);
 
 done_testing();