9 can_ok('Class::MOP::Class', 'meta');
10 isa_ok(Class::MOP::Class->meta->find_method_by_name('meta'),
11 'Class::MOP::Method::Meta');
17 can_ok('Baz', 'meta');
18 isa_ok(Baz->meta->find_method_by_name('meta'),
19 'Class::MOP::Method::Meta');
21 my $meta = Class::MOP::Class->create('Quux');
22 can_ok('Quux', 'meta');
23 isa_ok(Quux->meta->find_method_by_name('meta'),
24 'Class::MOP::Method::Meta');
30 use metaclass meta_name => 'blarg';
32 ok(!Blarg->can('meta'));
33 can_ok('Blarg', 'blarg');
34 isa_ok(Blarg->blarg->find_method_by_name('blarg'),
35 'Class::MOP::Method::Meta');
37 my $meta = Class::MOP::Class->create('Blorg', meta_name => 'blorg');
38 ok(!Blorg->can('meta'));
39 can_ok('Blorg', 'blorg');
40 isa_ok(Blorg->blorg->find_method_by_name('blorg'),
41 'Class::MOP::Method::Meta');
47 use metaclass meta_name => undef;
50 my $meta = Class::MOP::class_of('Foo');
51 ok(!$meta->has_method('meta'), "no meta method was installed");
52 $meta->add_method(meta => sub { die 'META' });
53 ok ! exception { $meta->find_method_by_name('meta') }, "can do meta-level stuff";
54 ok ! exception { $meta->make_immutable }, "can do meta-level stuff";
55 ok ! exception { $meta->class_precedence_list }, "can do meta-level stuff";
59 my $meta = Class::MOP::Class->create('Bar', meta_name => undef);
60 ok(!$meta->has_method('meta'), "no meta method was installed");
61 $meta->add_method(meta => sub { die 'META' });
62 ok ! exception { $meta->find_method_by_name('meta') }, "can do meta-level stuff";
63 ok ! exception { $meta->make_immutable }, "can do meta-level stuff";
64 ok ! exception { $meta->class_precedence_list }, "can do meta-level stuff";