X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Finstance.t;h=0cf4f5c1a875a928502c1d808a84e7d6add42270;hb=1ac1adaa4eff9e2237bd50af383b7d93aa1bcabf;hp=687b470cf43fbe9cd5c02f5151b21deba4937438;hpb=d78f8e746b0fc4ab8e44dfa9ea7dcc8f28cce880;p=gitmo%2FMooseX-StrictConstructor.git diff --git a/t/instance.t b/t/instance.t index 687b470..0cf4f5c 100644 --- a/t/instance.t +++ b/t/instance.t @@ -3,6 +3,7 @@ use warnings; use Test::More; use Test::Moose qw( with_immutable ); +use Test::Fatal; { package Foo; @@ -11,11 +12,17 @@ use Test::Moose qw( with_immutable ); } with_immutable { - eval { Foo->new( __INSTANCE__ => Foo->new ); }; - ok( !$@, '__INSTANCE__ is ignored when passed to ->new' ); + is( + exception { Foo->new( __INSTANCE__ => Foo->new ) }, + undef, + '__INSTANCE__ is ignored when passed to ->new', + ); - eval { Foo->meta->new_object( __INSTANCE__ => Foo->new ); }; - ok( !$@, '__INSTANCE__ is ignored when passed to ->new_object' ); + is( + exception { Foo->meta->new_object( __INSTANCE__ => Foo->new ) }, + undef, + '__INSTANCE__ is ignored when passed to ->new_object', + ); } 'Foo';