X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F100_bugs%2Ffailing%2F023_DEMOLISH_fails_without_metaclass.t;fp=t%2F100_bugs%2Ffailing%2F023_DEMOLISH_fails_without_metaclass.t;h=0000000000000000000000000000000000000000;hb=c47cf41554416ee1828eab17d31342a53aaa0839;hp=a0384568b77d923bb637c2a1649e777db16ca56f;hpb=9864f0e4ba233c5f30ad6dc7c484ced43d883d27;p=gitmo%2FMouse.git diff --git a/t/100_bugs/failing/023_DEMOLISH_fails_without_metaclass.t b/t/100_bugs/failing/023_DEMOLISH_fails_without_metaclass.t deleted file mode 100644 index a038456..0000000 --- a/t/100_bugs/failing/023_DEMOLISH_fails_without_metaclass.t +++ /dev/null @@ -1,34 +0,0 @@ -use strict; -use warnings; - -use Test::More tests => 2; -use Test::Exception; - -{ - package MyClass; - use Mouse; - - sub DEMOLISH { } -} - -my $object = MyClass->new; - -# Removing the metaclass simulates the case where the metaclass object -# goes out of scope _before_ the object itself, which under normal -# circumstances only happens during global destruction. -Class::MOP::remove_metaclass_by_name('MyClass'); - -# The bug happened when DEMOLISHALL called -# Class::MOP::class_of($object) and did not get a metaclass object -# back. -lives_ok { $object->DESTROY } -'can call DESTROY on an object without a metaclass object in the CMOP cache'; - - -MyClass->meta->make_immutable; -Class::MOP::remove_metaclass_by_name('MyClass'); - -# The bug didn't manifest for immutable objects, but this test should -# help us prevent it happening in the future. -lives_ok { $object->DESTROY } -'can call DESTROY on an object without a metaclass object in the CMOP cache (immutable version)';