X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100_bugs%2F017_type_constraint_messages.t;h=e6e5a19ff6904a76c30847b29bea4a43f4f0201b;hb=b10dde3a27c11623547417c599ccbd4f92e42651;hp=526130d819bf182546d3ecf4271468abd1726eec;hpb=d4e538d9bf46d1c14d2ecfd36ac35ed541ae7ee6;p=gitmo%2FMoose.git diff --git a/t/100_bugs/017_type_constraint_messages.t b/t/100_bugs/017_type_constraint_messages.t index 526130d..e6e5a19 100644 --- a/t/100_bugs/017_type_constraint_messages.t +++ b/t/100_bugs/017_type_constraint_messages.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; # RT #37569 @@ -52,22 +52,16 @@ use Test::Exception; my $foo = Foo->new; my $obj = MyObject->new; -throws_ok { +like( exception { $foo->ar( [] ); -} -qr/Attribute \(ar\) does not pass the type constraint because: ref: ARRAY/, - '... got the right error message'; +}, qr/Attribute \(ar\) does not pass the type constraint because: ref: ARRAY/, '... got the right error message' ); -throws_ok { +like( exception { $foo->obj($foo); # Doh! -} -qr/Attribute \(obj\) does not pass the type constraint because: Well it is an object/, - '... got the right error message'; +}, qr/Attribute \(obj\) does not pass the type constraint because: Well it is an object/, '... got the right error message' ); -throws_ok { +like( exception { $foo->nt($foo); # scalar -} -qr/Attribute \(nt\) does not pass the type constraint because: blessed/, - '... got the right error message'; +}, qr/Attribute \(nt\) does not pass the type constraint because: blessed/, '... got the right error message' ); done_testing;