X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F073_make_mutable.t;h=66b432a96ec3fa08c861b964af88026fee490c6c;hb=229910b5cf0bee35e072db0f8305e799241d4366;hp=e7532080c60ae256e2f050ffeaea65a5f07904c5;hpb=a92a3fc064057221cf555728a34901c8062fb069;p=gitmo%2FClass-MOP.git diff --git a/t/073_make_mutable.t b/t/073_make_mutable.t index e753208..66b432a 100644 --- a/t/073_make_mutable.t +++ b/t/073_make_mutable.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 104; +use Test::More tests => 108; use Test::Exception; use Scalar::Util; @@ -51,11 +51,13 @@ BEGIN { ok(!$meta->is_mutable, '... our class is no longer mutable'); ok($meta->is_immutable, '... our class is now immutable'); ok(!$meta->make_immutable, '... make immutable now returns nothing'); + ok($meta->get_method_map->{new}, '... inlined constructor created'); lives_ok { $meta->make_mutable; } '... changed Baz to be mutable'; ok($meta->is_mutable, '... our class is mutable'); ok(!$meta->is_immutable, '... our class is not immutable'); ok(!$meta->make_mutable, '... make mutable now returns nothing'); + ok(!$meta->get_method_map->{new}, '... inlined constructor removed'); my @new_keys = sort keys %$meta; is_deeply(\@orig_keys, \@new_keys, '... no straneous hashkeys'); @@ -88,6 +90,9 @@ BEGIN { ok( $meta->$_ , "... ${_} works") for qw(get_meta_instance compute_all_applicable_attributes class_precedence_list get_method_map ); + + lives_ok {$meta->make_immutable; } '... changed Baz to be immutable again'; + ok($meta->get_method_map->{new}, '... inlined constructor recreated'); } {