use warnings;
use Test::More;
-use Test::Exception;
+use Test::Fatal;
use ok 'MooseX::Types::DateTime';
isa_ok( Foo->new( date => 'now' )->date, "DateTime" );
- throws_ok { Foo->new( date => "junk1!!" ) } qr/DateTime/, "constraint";
+ like(exception { Foo->new( date => "junk1!!" ) }, qr/DateTime/, "constraint");
}
{
isa_ok( Quxx->new( duration => { minutes => 2 } )->duration, "DateTime::Duration", "coerced from hash" );
- throws_ok { Quxx->new( duration => "ahdstkljhat" ) } qr/DateTime/, "constraint";
+ like(exception { Quxx->new( duration => "ahdstkljhat" ) }, qr/DateTime/, "constraint");
}
{
like( $tz->name, qr/^Africa/, "correct time zone" );
- dies_ok { Bar->new( time_zone => "Space/TheMoon" ) } "bad time zone";
+ like(exception { Bar->new( time_zone => "Space/TheMoon" ) }, qr{The timezone 'Space/TheMoon' could not be loaded}, "bad time zone");
}
{
isa_ok( $loc, "DateTime::Locale::he", "coerced from string" );
- dies_ok { Gorch->new( loc => "not_a_place_or_a_locale" ) } "bad locale name";
+ like(exception { Gorch->new( loc => "not_a_place_or_a_locale" ) }, qr/Invalid locale/, "bad locale name");
SKIP: {
skip "No Locale::Maketext", 2 unless eval { require Locale::Maketext };