X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100_bugs%2F017_type_constraint_messages.t;h=526130d819bf182546d3ecf4271468abd1726eec;hb=34d6d196372ac514abfe975cef15e8afd0af04c4;hp=d425787f199cda793881d7423b67ef3ed549fa38;hpb=d5598adee5228c5f03d24157cf23b3889637e1be;p=gitmo%2FMoose.git diff --git a/t/100_bugs/017_type_constraint_messages.t b/t/100_bugs/017_type_constraint_messages.t index d425787..526130d 100644 --- a/t/100_bugs/017_type_constraint_messages.t +++ b/t/100_bugs/017_type_constraint_messages.t @@ -3,12 +3,9 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More; use Test::Exception; -BEGIN { - use_ok('Moose'); -} # RT #37569 @@ -23,7 +20,7 @@ BEGIN { subtype 'MyArrayRef' => as 'ArrayRef' => where { defined $_->[0] } - => message { ref $_ ? "ref: ". ref $_ : 'scalar' } # stringy + => message { ref $_ ? "ref: ". ref $_ : 'scalar' } # stringy ; subtype 'MyObjectType' @@ -55,16 +52,22 @@ BEGIN { my $foo = Foo->new; my $obj = MyObject->new; -throws_ok { - $foo->ar([]); -} qr/Attribute \(ar\) does not pass the type constraint because: ref: ARRAY/, '... got the right error message'; - -throws_ok { - $foo->obj($foo); # Doh! -} qr/Attribute \(obj\) does not pass the type constraint because: Well it is an object/, '... got the right error message'; +throws_ok { + $foo->ar( [] ); +} +qr/Attribute \(ar\) does not pass the type constraint because: ref: ARRAY/, + '... got the right error message'; -throws_ok { - $foo->nt($foo); # scalar -} qr/Attribute \(nt\) does not pass the type constraint because: blessed/, '... got the right error message'; +throws_ok { + $foo->obj($foo); # Doh! +} +qr/Attribute \(obj\) does not pass the type constraint because: Well it is an object/, + '... got the right error message'; +throws_ok { + $foo->nt($foo); # scalar +} +qr/Attribute \(nt\) does not pass the type constraint because: blessed/, + '... got the right error message'; +done_testing;