X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMooseX-Params-Validate.git;a=blobdiff_plain;f=t%2F003_nocache_flag.t;h=5ef7babbed4781aef266c490720d65544bdb0149;hp=a1ae689db92017f75fcc4db59435c30946794b25;hb=37088308c844e2ea22f3b2af621b028d029fe759;hpb=dc5318a9933a5be5c81ee49eb0c3afd3bb8562e6 diff --git a/t/003_nocache_flag.t b/t/003_nocache_flag.t index a1ae689..5ef7bab 100644 --- a/t/003_nocache_flag.t +++ b/t/003_nocache_flag.t @@ -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();