4 use Test::More tests => 14;
12 predicate => 'has_pawn',
18 my $meta = Class->meta;
19 isa_ok($meta, 'Mouse::Meta::Class');
21 is_deeply([$meta->superclasses], ['Mouse::Object'], "correctly inherting from Mouse::Object");
23 my $meta2 = Class->meta;
24 is($meta, $meta2, "same metaclass instance");
26 can_ok($meta, 'name', 'get_attribute_map');
28 ok($meta->has_attribute('pawn'));
29 my $attr = $meta->get_attribute('pawn');
30 isa_ok($attr, 'Mouse::Meta::Attribute');
31 is($attr->name, 'pawn', 'got the correct attribute');
33 my $map = $meta->get_attribute_map;
34 is_deeply($map, { pawn => $attr }, "attribute map");
36 ok(!$meta->has_attribute('nonexistent_attribute'));
44 my $meta3 = Class->meta;
45 is($meta, $meta3, "same metaclass instance, even if use Mouse is performed again");
47 is($meta->name, 'Class', "name for the metaclass");
55 my $child_meta = Child->meta;
56 isa_ok($child_meta, 'Mouse::Meta::Class');
58 isnt($meta, $child_meta, "different metaclass instances for the two classes");
60 is_deeply([$child_meta->superclasses], ['Class'], "correct superclasses");