allow single-value enums
[gitmo/Moose.git] / t / type_constraints / enum.t
index 6a55ec1..7349c48 100644 (file)
@@ -63,9 +63,9 @@ ok( !$anon_enum->is_subtype_of('ThisTypeDoesNotExist'), 'enum not a subtype of n
 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 => []) }, qr/You must have at least two values to enumerate through/ );
+like( exception { Moose::Meta::TypeConstraint::Enum->new(name => 'ZeroValues', values => []) }, qr/You must have at least one value to enumerate through/ );
 
-like( exception { Moose::Meta::TypeConstraint::Enum->new(name => 'OneValue', values => [ 'a' ]) }, qr/You must have at least two values to enumerate through/ );
+is( exception { Moose::Meta::TypeConstraint::Enum->new(name => 'OneValue', values => [ 'a' ]) }, undef);
 
 like( exception { Moose::Meta::TypeConstraint::Enum->new(name => 'ReferenceInEnum', values => [ 'a', {} ]) }, qr/Enum values must be strings, not 'HASH\(0x\w+\)'/ );