use warnings;
use Test::More;
-use Test::Fatal;
+use Test::Exception;
use Scalar::Util ();
"This is not a string (5)",
'... validated unsuccessfully (got error)');
-ok ! exception { Moose::Meta::Attribute->new('bob', isa => 'Spong') },
+lives_ok { Moose::Meta::Attribute->new('bob', isa => 'Spong') }
'meta-attr construction ok even when type constraint utils loaded first';
# Test type constraint predicate return values.
# Test adding things which don't look like types to the registry throws an exception
my $r = Moose::Util::TypeConstraints->get_type_constraint_registry;
-like exception {$r->add_type_constraint()}, qr/not a valid type constraint/, '->add_type_constraint(undef) throws';
-like exception {$r->add_type_constraint('foo')}, qr/not a valid type constraint/, '->add_type_constraint("foo") throws';
-like exception {$r->add_type_constraint(bless {}, 'SomeClass')}, qr/not a valid type constraint/, '->add_type_constraint(SomeClass->new) throws';
+throws_ok {$r->add_type_constraint()} qr/not a valid type constraint/, '->add_type_constraint(undef) throws';
+throws_ok {$r->add_type_constraint('foo')} qr/not a valid type constraint/, '->add_type_constraint("foo") throws';
+throws_ok {$r->add_type_constraint(bless {}, 'SomeClass')} qr/not a valid type constraint/, '->add_type_constraint(SomeClass->new) throws';
# Test some specific things that in the past did not work,
# specifically weird variations on anon subtypes.
}
{
- like exception { subtype 'Foo' }, qr/cannot consist solely of a name/,
+ throws_ok { subtype 'Foo' } qr/cannot consist solely of a name/,
'Cannot call subtype with a single string argument';
}