From: Yuval Kogman Date: Fri, 27 Jun 2008 09:51:42 +0000 (+0000) Subject: test under various mutablation scenarios X-Git-Tag: 0_55~80 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6f5dbcd54a112d0a6b220ffa437b812b052b0b2a;p=gitmo%2FMoose.git test under various mutablation scenarios --- diff --git a/t/100_bugs/015_immutable_n_around.t b/t/100_bugs/015_immutable_n_around.t index a5f9987..3ce80cf 100644 --- a/t/100_bugs/015_immutable_n_around.t +++ b/t/100_bugs/015_immutable_n_around.t @@ -13,8 +13,6 @@ use Test::More 'no_plan'; has foo => ( is => "ro" ); - __PACKAGE__->meta->make_immutable; - package Bar; use Moose; @@ -26,14 +24,25 @@ use Test::More 'no_plan'; $self->$next( foo => 42 ); }; - __PACKAGE__->meta->make_immutable; - package Gorch; use Moose; extends qw(Bar); - __PACKAGE__->meta->make_immutable; + package Zoink; + use Moose; + + extends qw(Gorch); + } -is( Gorch->new->foo, 42, "around new called" ); +my @classes = qw(Foo Bar Gorch Zoink); + +do { + is( Foo->new->foo, undef, "base class (" . (Foo->meta->is_immutable ? "immutable" : "mutable") . ")" ); + is( Bar->new->foo, 42, "around new called on Bar->new (" . (Bar->meta->is_immutable ? "immutable" : "mutable") . ")" ); + is( Gorch->new->foo, 42, "around new called on Gorch->new (" . (Gorch->meta->is_immutable ? "immutable" : "mutable") . ")" ); + is( Zoink->new->foo, 42, "around new called Zoink->new (" . (Zoink->meta->is_immutable ? "immutable" : "mutable") . ")" ); + + ( shift @classes )->meta->make_immutable; +} while @classes;