Remove immutable transformer
[gitmo/Class-MOP.git] / t / 073_make_mutable.t
index 5212491..d15626e 100644 (file)
@@ -1,7 +1,7 @@
 use strict;
 use warnings;
 
-use Test::More tests => 101;
+use Test::More tests => 99;
 use Test::Exception;
 
 use Scalar::Util;
@@ -44,7 +44,6 @@ use Class::MOP;
     my %orig_keys = map { $_ => 1 } grep { !/^_/ } keys %$meta;
     # Since this has no default it won't be present yet, but it will
     # be after the class is made immutable.
-    $orig_keys{immutable_transformer} = 1;
 
     lives_ok {$meta->make_immutable; } '... changed Baz to be immutable';
     ok(!$meta->is_mutable,              '... our class is no longer mutable');
@@ -52,8 +51,7 @@ use Class::MOP;
     ok(!$meta->make_immutable,          '... make immutable now returns nothing');
     ok($meta->get_method_map->{new},    '... inlined constructor created');
     ok($meta->has_method('new'),        '... inlined constructor created for sure');    
-    ok($meta->immutable_transformer->inlined_constructor,
-       '... transformer says it did inline the constructor');
+    is_deeply([ map { $_->name } $meta->_inlined_methods ], [ 'new' ], '... really, i mean it');
 
     lives_ok { $meta->make_mutable; }  '... changed Baz to be mutable';
     ok($meta->is_mutable,               '... our class is mutable');
@@ -61,8 +59,6 @@ use Class::MOP;
     ok(!$meta->make_mutable,            '... make mutable now returns nothing');
     ok(!$meta->get_method_map->{new},   '... inlined constructor removed');
     ok(!$meta->has_method('new'),        '... inlined constructor removed for sure');    
-    ok(!$meta->immutable_transformer->inlined_constructor,
-       '... transformer says it did not inline the constructor');
 
     my %new_keys = map { $_ => 1 } grep { !/^_/ } keys %$meta;
     is_deeply(\%orig_keys, \%new_keys, '... no extraneous hashkeys');
@@ -127,9 +123,7 @@ use Class::MOP;
     ok(Baz->meta->is_immutable,  'Superclass is immutable');
     my $meta = Baz->meta->create_anon_class(superclasses => ['Baz']);
     my %orig_keys = map { $_ => 1 } grep { !/^_/ } keys %$meta;
-    $orig_keys{immutable_transformer} = 1;
-    my @orig_meths = sort { $a->name cmp $b->name }
-      $meta->get_all_methods;
+    my @orig_meths = sort { $a->name cmp $b->name } $meta->get_all_methods;
     ok($meta->is_anon_class,                  'We have an anon metaclass');
     ok($meta->is_mutable,  '... our anon class is mutable');
     ok(!$meta->is_immutable,  '... our anon class is not immutable');
@@ -221,7 +215,4 @@ use Class::MOP;
     Foo->meta->make_immutable;
     Bar->meta->make_immutable;
     Bar->meta->make_mutable;
-
-    isnt( Foo->meta->immutable_transformer, Bar->meta->immutable_transformer,
-          'Foo and Bar should have different immutable transformer objects' );
 }