6 use Test::More no_plan => 1;
11 use_ok('Class::MOP::Class');
14 my $meta = Class::MOP::Class->meta();
15 isa_ok($meta, 'Class::MOP::Class');
17 foreach my $method_name (qw(
24 superclasses class_precedence_list
26 has_method get_method add_method remove_method
27 get_method_list compute_all_applicable_methods find_all_methods_by_name
29 has_attribute get_attribute add_attribute remove_attribute
30 get_attribute_list compute_all_applicable_attributes
32 ok($meta->has_method($method_name), '... Class::MOP::Class->has_method(' . $method_name . ')');
35 is($meta->get_method($method_name),
36 \&{'Class::MOP::Class::' . $method_name},
37 '... Class::MOP::Class->get_method(' . $method_name . ') == &Class::MOP::Class::' . $method_name);
41 foreach my $non_method_name (qw(
47 ok(!$meta->has_method($non_method_name), '... NOT Class::MOP::Class->has_method(' . $non_method_name . ')');
50 foreach my $attribute_name (
53 ok($meta->has_attribute($attribute_name), '... Class::MOP::Class->has_attribute(' . $attribute_name . ')');
54 isa_ok($meta->get_attribute($attribute_name), 'Class::MOP::Attribute');
57 is($meta->name, 'Class::MOP::Class', '... Class::MOP::Class->name');
58 is($meta->version, $Class::MOP::Class::VERSION, '... Class::MOP::Class->version');
61 [ $meta->superclasses ],
63 '... Class::MOP::Class->superclasses == []');
66 [ $meta->class_precedence_list ],
67 [ 'Class::MOP::Class' ],
68 '... Class::MOP::Class->class_precedence_list == []');