From: Dave Rolsky Date: Tue, 30 Jun 2009 19:38:25 +0000 (-0500) Subject: Attempting to call ->make_immutable on a class instead of an object is X-Git-Tag: 0.89~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=d7532ce027e97addad1fe7b45d33f1aca24ff3a7;p=gitmo%2FClass-MOP.git Attempting to call ->make_immutable on a class instead of an object is just wrong, even if it accidentally works. --- diff --git a/t/070_immutable_metaclass.t b/t/070_immutable_metaclass.t index 1a49fd7..d7b1c4d 100644 --- a/t/070_immutable_metaclass.t +++ b/t/070_immutable_metaclass.t @@ -44,13 +44,11 @@ use Class::MOP; my $immutable_metaclass = $meta->_immutable_metaclass->meta; - my $obj = $immutable_metaclass->name; + my $immutable_class_name = $immutable_metaclass->name; - ok( !$obj->is_mutable, '... immutable_metaclass is not mutable' ); - ok( $obj->is_immutable, '... immutable_metaclass is immutable' ); - ok( !$obj->make_immutable, - '... immutable_metaclass make_mutable is noop' ); - is( $obj->meta, $immutable_metaclass, + ok( !$immutable_class_name->is_mutable, '... immutable_metaclass is not mutable' ); + ok( $immutable_class_name->is_immutable, '... immutable_metaclass is immutable' ); + is( $immutable_class_name->meta, $immutable_metaclass, '... immutable_metaclass meta hack works' ); isa_ok( $meta, "Class::MOP::Class::Immutable::Trait" );