X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F010_basics%2F017_error_handling.t;h=5400327e49ebc79e4e9b9da570513674bf498e5b;hb=b10dde3a27c11623547417c599ccbd4f92e42651;hp=542c79c17f7848b4e1da870e819aec35499f41a9;hpb=d4e538d9bf46d1c14d2ecfd36ac35ed541ae7ee6;p=gitmo%2FMoose.git diff --git a/t/010_basics/017_error_handling.t b/t/010_basics/017_error_handling.t index 542c79c..5400327 100644 --- a/t/010_basics/017_error_handling.t +++ b/t/010_basics/017_error_handling.t @@ -4,7 +4,7 @@ use strict; use warnings; use Test::More; -use Test::Exception; +use Test::Fatal; # This tests the error handling in Moose::Object only @@ -13,12 +13,9 @@ use Test::Exception; use Moose; } -throws_ok { Foo->new('bad') } qr/^\QSingle parameters to new() must be a HASH ref/, - 'A single non-hashref arg to a constructor throws an error'; -throws_ok { Foo->new(undef) } qr/^\QSingle parameters to new() must be a HASH ref/, - 'A single non-hashref arg to a constructor throws an error'; +like( exception { Foo->new('bad') }, qr/^\QSingle parameters to new() must be a HASH ref/, 'A single non-hashref arg to a constructor throws an error' ); +like( exception { Foo->new(undef) }, qr/^\QSingle parameters to new() must be a HASH ref/, 'A single non-hashref arg to a constructor throws an error' ); -throws_ok { Foo->does() } qr/^\QYou must supply a role name to does()/, - 'Cannot call does() without a role name'; +like( exception { Foo->does() }, qr/^\QYou must supply a role name to does()/, 'Cannot call does() without a role name' ); done_testing;