From: Jesse Luehrs Date: Mon, 22 Jun 2009 14:27:26 +0000 (-0500) Subject: make this test more correct with regards to immutability of metaclasses X-Git-Tag: 0.83~6 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b4633c880e6a1be8ea71b5dac58bc60661969820;p=gitmo%2FMoose.git make this test more correct with regards to immutability of metaclasses --- diff --git a/t/300_immutable/014_immutable_metaclass_with_traits.t b/t/300_immutable/014_immutable_metaclass_with_traits.t index e3b68b2..30d74e5 100644 --- a/t/300_immutable/014_immutable_metaclass_with_traits.t +++ b/t/300_immutable/014_immutable_metaclass_with_traits.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 10; +use Test::More tests => 12; { package FooTrait; @@ -19,16 +19,18 @@ is(Class::MOP::class_of($meta), $meta->meta, "class_of and ->meta are the same on Foo's metaclass"); isa_ok(Class::MOP::class_of($meta), 'Moose::Meta::Class'); isa_ok($meta->meta, 'Moose::Meta::Class'); +ok($meta->is_mutable, "class is mutable"); +ok(Class::MOP::class_of($meta)->is_mutable, "metaclass is mutable"); Foo->meta->make_immutable; is(Class::MOP::class_of('Foo'), Foo->meta, "class_of and ->meta are the same on Foo (immutable)"); $meta = Foo->meta; isa_ok($meta->meta, 'Moose::Meta::Class'); -ok(Class::MOP::class_of($meta)->is_immutable, "metaclass is immutable"); +ok($meta->is_immutable, "class is immutable"); +ok($meta->meta->is_mutable, "metaclass is mutable (immutable class)"); TODO: { local $TODO = "immutable metaclasses with traits do weird things"; is(Class::MOP::class_of($meta), $meta->meta, "class_of and ->meta are the same on Foo's metaclass (immutable)"); isa_ok(Class::MOP::class_of($meta), 'Moose::Meta::Class'); - ok($meta->meta->is_immutable, "metaclass is immutable"); }