From: Ricardo SIGNES Date: Thu, 4 Dec 2008 19:06:58 +0000 (+0000) Subject: test for isa improvement X-Git-Tag: 0.19~146 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMouse.git;a=commitdiff_plain;h=285764da74dfbb53dedbf8f4bd50d54ddbaf5ced test for isa improvement --- diff --git a/t/025-more-isa.t b/t/025-more-isa.t index f092bed..73ba022 100644 --- a/t/025-more-isa.t +++ b/t/025-more-isa.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 29; +use Test::More tests => 30; use Mouse::Util ':test'; do { @@ -12,6 +12,9 @@ do { is => 'rw', isa => 'Test::Builder', ); + + package Test::Builder::Subclass; + our @ISA = qw(Test::Builder); }; can_ok(Class => 'tb'); @@ -21,6 +24,13 @@ lives_ok { }; 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 + Class->new(tb => (bless {} => 'Test::Builder::Subclass')); +}; + +lives_ok { my $class = Class->new; $class->tb(Test::Builder->new); isa_ok($class->tb, 'Test::Builder');