X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F025-more-isa.t;h=6e621a7e3a1689cb5a202de6b83a60d232e3c32a;hb=c9313657717f78bd96f0325c6aa1c93d0b0d41a5;hp=022c89c495ed083aefc1a1d9be13bab0dac35fc7;hpb=74be9f760d045a0174d76e54de1c66d6b66454c4;p=gitmo%2FMouse.git diff --git a/t/025-more-isa.t b/t/025-more-isa.t index 022c89c..6e621a7 100755 --- a/t/025-more-isa.t +++ b/t/025-more-isa.t @@ -74,7 +74,7 @@ do { package A; our @VERSION; - package B; + package Bx; # 'B' conflicts the B module our $VERSION = 1; package C; @@ -92,6 +92,7 @@ do { sub bar {} package I; + no warnings 'once'; # work around 5.6.2 our $NOT_CODE = 1; }; @@ -105,7 +106,7 @@ do { ); }; -for ('B'..'E', 'G::H') { +for ('Bx', 'D'..'E', 'G::H') { lives_ok { ClassNameTests->new(class => $_); }; @@ -116,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 {