use strict;
use warnings;
- use Test::More tests => 254;
-use Test::More tests => 250;
++use Test::More tests => 260;
use Test::Exception;
use Class::MOP;
create_anon_class is_anon_class
- instance_metaclass get_meta_instance create_meta_instance
+ instance_metaclass get_meta_instance
+ create_meta_instance _create_meta_instance
new_object clone_object
- construct_instance construct_class_instance clone_instance
+ construct_instance
+ construct_class_instance _construct_class_instance
+ clone_instance _clone_instance
- rebless_instance
+ rebless_instance rebless_instance_away
- check_metaclass_compatibility
+ check_metaclass_compatibility _check_metaclass_compatibility
add_meta_instance_dependencies remove_meta_instance_dependencies update_meta_instance_dependencies
add_dependent_meta_instance remove_dependent_meta_instance
ok(Baz->meta->is_immutable, 'Superclass is immutable');
my $meta = Baz->meta->create_anon_class(superclasses => ['Baz']);
- my @orig_keys = sort grep { !/^_/ } keys %$meta;
+ my %orig_keys = map { $_ => 1 } grep { !/^_/ } keys %$meta;
+ $orig_keys{immutable_transformer} = 1;
- my @orig_meths = sort { $a->{name} cmp $b->{name} }
- $meta->compute_all_applicable_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');
ok($meta->is_anon_class, '... still marked as an anon class');
my $instance = $meta->new_object;
- my @new_keys = sort grep { !/^_/ } keys %$meta;
+ my %new_keys = map { $_ => 1 } grep { !/^_/ } keys %$meta;
- my @new_meths = sort { $a->{name} cmp $b->{name} }
- $meta->compute_all_applicable_methods;
+ my @new_meths = sort { $a->name cmp $b->name }
+ $meta->get_all_methods;
- is_deeply(\@orig_keys, \@new_keys, '... no straneous hashkeys');
+ is_deeply(\%orig_keys, \%new_keys, '... no extraneous hashkeys');
- is_deeply(\@orig_meths, \@new_meths, '... no extraneous methods');
+ is_deeply(\@orig_meths, \@new_meths, '... no straneous methods');
isa_ok($meta, 'Class::MOP::Class', '... Anon class isa Class::MOP::Class');