X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Finstance.t;fp=t%2Finstance.t;h=0cf4f5c1a875a928502c1d808a84e7d6add42270;hb=a2edc41946145b8b31636c39c0c1605e1adf5251;hp=687b470cf43fbe9cd5c02f5151b21deba4937438;hpb=93d0a6c1068cd62cfc91d56df562d23cbb67e369;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';