X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F001_mouse%2F025-more-isa.t;h=c2d6ba247ef1ac280a707f67d09efbaf47aeeb7d;hb=HEAD;hp=c2b69a9747bd77bc6da19649b31c41956df4fa8c;hpb=537873b064ad328ea662e3792b128d9b016ed38a;p=gitmo%2FMouse.git diff --git a/t/001_mouse/025-more-isa.t b/t/001_mouse/025-more-isa.t index c2b69a9..c2d6ba2 100644 --- a/t/001_mouse/025-more-isa.t +++ b/t/001_mouse/025-more-isa.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 34; +use Test::More; use Test::Exception; do { @@ -13,6 +13,11 @@ do { isa => 'Test::Builder', ); + has obj => ( + is => 'rw', + isa => 'UNIVERSAL', + ); + package Test::Builder::Subclass; our @ISA = qw(Test::Builder); }; @@ -24,6 +29,10 @@ lives_ok { }; lives_ok { + Class->new(obj => Test::Builder->new); +}; + +lives_ok { # Test::Builder was a bizarre choice, because it's a singleton. Because of # that calling new on T:B:S won't work. Blessing directly -- rjbs, # 2008-12-04 @@ -49,6 +58,10 @@ throws_ok { Class->new(tb => Class->new); } qr/Attribute \(tb\) does not pass the type constraint because: Validation failed for 'Test::Builder' with value Class=HASH\(\w+\)/; +throws_ok { + Class->new(obj => 42); +} qr/Attribute \(obj\) does not pass the type constraint because: Validation failed for 'UNIVERSAL' with value 42/; + do { package Other; use Mouse; @@ -180,3 +193,4 @@ throws_ok { $hs->sausage(Class->new); } qr/^Attribute \(sausage\) does not pass the type constraint because: Validation failed for 'SausageRole' with value Class=/; +done_testing;