use warnings;
use Test::More;
-use Test::Fatal;
+use Test::Exception;
use Scalar::Util ();
ok( !$anon_enum->is_a_type_of('ThisTypeDoesNotExist'), 'enum not type of nonexistant type');
# validation
-like exception { Moose::Meta::TypeConstraint::Enum->new(name => 'ZeroValues', values => []) },
+throws_ok { Moose::Meta::TypeConstraint::Enum->new(name => 'ZeroValues', values => []) }
qr/You must have at least two values to enumerate through/;
-like exception { Moose::Meta::TypeConstraint::Enum->new(name => 'OneValue', values => [ 'a' ]) },
+throws_ok { Moose::Meta::TypeConstraint::Enum->new(name => 'OneValue', values => [ 'a' ]) }
qr/You must have at least two values to enumerate through/;
-like exception { Moose::Meta::TypeConstraint::Enum->new(name => 'ReferenceInEnum', values => [ 'a', {} ]) },
+throws_ok { Moose::Meta::TypeConstraint::Enum->new(name => 'ReferenceInEnum', values => [ 'a', {} ]) }
qr/Enum values must be strings, not 'HASH\(0x\w+\)'/;
-like exception { Moose::Meta::TypeConstraint::Enum->new(name => 'UndefInEnum', values => [ 'a', undef ]) },
+throws_ok { Moose::Meta::TypeConstraint::Enum->new(name => 'UndefInEnum', values => [ 'a', undef ]) }
qr/Enum values must be strings, not undef/;
-like exception {
+throws_ok {
package Foo;
use Moose;
use Moose::Util::TypeConstraints;
isa => enum ['a', 'aa', 'aaa'], # should be parenthesized!
default => 'aa',
);
-}, qr/enum called with an array reference and additional arguments\. Did you mean to parenthesize the enum call's parameters\?/;
+} qr/enum called with an array reference and additional arguments\. Did you mean to parenthesize the enum call's parameters\?/;
done_testing;