X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F025-more-isa.t;h=6e621a7e3a1689cb5a202de6b83a60d232e3c32a;hb=8cbcbb47d0f02077d07873c553494a884d9c085f;hp=576d5e1e61b8a27d42cb5f50726c3450d9b0264c;hpb=5c5a61e0daea184cff679a815d6fc4cdbe08bc33;p=gitmo%2FMouse.git diff --git a/t/025-more-isa.t b/t/025-more-isa.t index 576d5e1..6e621a7 100755 --- a/t/025-more-isa.t +++ b/t/025-more-isa.t @@ -54,6 +54,7 @@ do { use Mouse; has oops => ( + is => 'bare', isa => 'Int', default => "yikes", ); @@ -73,7 +74,7 @@ do { package A; our @VERSION; - package B; + package Bx; # 'B' conflicts the B module our $VERSION = 1; package C; @@ -91,6 +92,7 @@ do { sub bar {} package I; + no warnings 'once'; # work around 5.6.2 our $NOT_CODE = 1; }; @@ -104,7 +106,7 @@ do { ); }; -for ('B'..'E', 'G::H') { +for ('Bx', 'D'..'E', 'G::H') { lives_ok { ClassNameTests->new(class => $_); }; @@ -115,17 +117,23 @@ for ('B'..'E', 'G::H') { }; } -TODO: { - local $TODO = "Moose throws errors here. Mouse does not"; - throws_ok { - ClassNameTests->new(class => 'A'); - } qr/Attribute \(class\) does not pass the type constraint because: Validation failed for 'ClassName' failed with value A/; +throws_ok { + ClassNameTests->new(class => 'A'); +} qr/Attribute \(class\) does not pass the type constraint because: Validation failed for 'ClassName' failed with value A/; - throws_ok { - my $obj = ClassNameTests->new; - $obj->class('A'); - } qr/Attribute \(class\) does not pass the type constraint because: Validation failed for 'ClassName' failed with value A/; -} +throws_ok { + my $obj = ClassNameTests->new; + $obj->class('A'); +} qr/Attribute \(class\) does not pass the type constraint because: Validation failed for 'ClassName' failed with value A/; + +throws_ok { + ClassNameTests->new(class => 'C'); +} qr/Attribute \(class\) does not pass the type constraint because: Validation failed for 'ClassName' failed with value C/; + +throws_ok { + my $obj = ClassNameTests->new; + $obj->class('C'); +} qr/Attribute \(class\) does not pass the type constraint because: Validation failed for 'ClassName' failed with value C/; for ('F', 'G', 'I', 'Z') { throws_ok {