From: Dave Rolsky Date: Wed, 31 Dec 2008 16:36:43 +0000 (+0000) Subject: fix tests broken by the fix to make immutable transformers unique per class X-Git-Tag: 0.75^0 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b5ade142030a79b9c102f3997814ba3f594d3897;p=gitmo%2FClass-MOP.git fix tests broken by the fix to make immutable transformers unique per class --- diff --git a/t/000_load.t b/t/000_load.t index 13f7358..0b187e0 100644 --- a/t/000_load.t +++ b/t/000_load.t @@ -23,8 +23,8 @@ BEGIN { # make sure we are tracking metaclasses correctly -my $CLASS_MOP_CLASS_IMMUTABLE_CLASS - = 'Class::MOP::Class::__ANON__::SERIAL::1'; +my @CLASS_MOP_CLASS_IMMUTABLE_CLASSES + = map { 'Class::MOP::Class::__ANON__::SERIAL::' . $_ } 1..11; my %METAS = ( 'Class::MOP::Attribute' => Class::MOP::Attribute->meta, @@ -51,8 +51,7 @@ is_deeply( {Class::MOP::get_all_metaclasses}, { %METAS, - $CLASS_MOP_CLASS_IMMUTABLE_CLASS => - $CLASS_MOP_CLASS_IMMUTABLE_CLASS->meta + map { $_ => $_->meta } @CLASS_MOP_CLASS_IMMUTABLE_CLASSES }, '... got all the metaclasses' ); @@ -64,7 +63,7 @@ is_deeply( [ Class::MOP::Attribute->meta, Class::MOP::Class->meta, - $CLASS_MOP_CLASS_IMMUTABLE_CLASS->meta, + ( map { $_->meta } sort @CLASS_MOP_CLASS_IMMUTABLE_CLASSES ), Class::MOP::Instance->meta, Class::MOP::Method->meta, Class::MOP::Method::Accessor->meta, @@ -93,7 +92,7 @@ is_deeply( Class::MOP::Module Class::MOP::Object Class::MOP::Package - /, $CLASS_MOP_CLASS_IMMUTABLE_CLASS + /, @CLASS_MOP_CLASS_IMMUTABLE_CLASSES ], '... got all the metaclass names' ); @@ -108,7 +107,7 @@ is_deeply( . $Class::MOP::Attribute::VERSION . "-cpan:STEVAN", "Class::MOP::Class-" . $Class::MOP::Class::VERSION . "-cpan:STEVAN", - $CLASS_MOP_CLASS_IMMUTABLE_CLASS, + ( sort @CLASS_MOP_CLASS_IMMUTABLE_CLASSES ), "Class::MOP::Instance-" . $Class::MOP::Instance::VERSION . "-cpan:STEVAN", diff --git a/t/071_immutable_w_custom_metaclass.t b/t/071_immutable_w_custom_metaclass.t index 961d71b..440f400 100644 --- a/t/071_immutable_w_custom_metaclass.t +++ b/t/071_immutable_w_custom_metaclass.t @@ -49,7 +49,8 @@ use lib catdir($FindBin::Bin, 'lib'); { my $meta = Baz->meta; ok($meta->is_mutable, '... Baz is mutable'); - is(Scalar::Util::blessed(Foo->meta), Scalar::Util::blessed(Bar->meta), 'Foo and Bar immutable metaclasses match'); + isnt(Scalar::Util::blessed(Foo->meta), Scalar::Util::blessed(Bar->meta), + 'Foo and Bar immutable metaclasses do not match'); is(Scalar::Util::blessed($meta), 'MyMetaClass', 'Baz->meta blessed as MyMetaClass'); ok(Baz->can('mymetaclass_attributes'), '... Baz can do method before immutable'); ok($meta->can('mymetaclass_attributes'), '... meta can do method before immutable');