From: Shawn M Moore Date: Thu, 27 Mar 2008 03:20:11 +0000 (+0000) Subject: Remove Str isa Str|ArrayRef tests (for now anyway) for design reasons X-Git-Tag: 0_55~257 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=55d6781e6dbf4ec68f4e2dbd2bac67fa1bb5af9e;p=gitmo%2FMoose.git Remove Str isa Str|ArrayRef tests (for now anyway) for design reasons --- diff --git a/t/040_type_constraints/008_union_types.t b/t/040_type_constraints/008_union_types.t index 86f0f7c..5ccf213 100644 --- a/t/040_type_constraints/008_union_types.t +++ b/t/040_type_constraints/008_union_types.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 34; +use Test::More tests => 27; use Test::Exception; BEGIN { @@ -67,17 +67,3 @@ is($HashOrArray->validate(50), 'Validation failed for \'ArrayRef\' failed with value 50 and Validation failed for \'HashRef\' failed with value 50 in (ArrayRef | HashRef)', '... (ArrayRef | HashRef) cannot accept Numbers'); -my $StrOrArray = Moose::Meta::TypeConstraint::Union->new(type_constraints => [$Str, $ArrayRef]); -isa_ok($StrOrArray, 'Moose::Meta::TypeConstraint'); - -ok(!defined($StrOrArray->validate("hi"))); -ok(!defined($StrOrArray->validate([]))); -ok(!defined($StrOrArray->validate([1]))); - -like($StrOrArray->validate({}), -qr/Validation failed for \'Str\' failed with value HASH\(0x.+?\) and Validation failed for \'ArrayRef\' failed with value HASH\(0x.+?\) in \(Str \| ArrayRef\)/, -'... (Str | ArrayRef) cannot accept HashRefs'); - -ok($Str->is_subtype_of($StrOrArray), "Str is a subtype of (Str | ArrayRef)"); -ok($ArrayRef->is_subtype_of($StrOrArray), "ArrayRef is a subtype of (Str | ArrayRef)" ); -