[Moose-commits] r7212 - Class-MOP/trunk/t
autarch at code2.0beta.co.uk
autarch at code2.0beta.co.uk
Wed Dec 31 16:36:44 GMT 2008
Author: autarch
Date: 2008-12-31 08:36:43 -0800 (Wed, 31 Dec 2008)
New Revision: 7212
Modified:
Class-MOP/trunk/t/000_load.t
Class-MOP/trunk/t/071_immutable_w_custom_metaclass.t
Log:
fix tests broken by the fix to make immutable transformers unique per class
Modified: Class-MOP/trunk/t/000_load.t
===================================================================
--- Class-MOP/trunk/t/000_load.t 2008-12-31 16:28:15 UTC (rev 7211)
+++ Class-MOP/trunk/t/000_load.t 2008-12-31 16:36:43 UTC (rev 7212)
@@ -23,8 +23,8 @@
# 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 @@
{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 @@
[
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 @@
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 @@
. $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",
Modified: Class-MOP/trunk/t/071_immutable_w_custom_metaclass.t
===================================================================
--- Class-MOP/trunk/t/071_immutable_w_custom_metaclass.t 2008-12-31 16:28:15 UTC (rev 7211)
+++ Class-MOP/trunk/t/071_immutable_w_custom_metaclass.t 2008-12-31 16:36:43 UTC (rev 7212)
@@ -49,7 +49,8 @@
{
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');
More information about the Moose-commits
mailing list