6 use Test::More tests => 12;
14 use base 'Class::MOP::Class';
17 use metaclass 'FooMeta';
20 can_ok('Foo', 'meta');
21 isa_ok(Foo->meta, 'FooMeta');
22 isa_ok(Foo->meta, 'Class::MOP::Class');
26 use base 'Class::MOP::Class';
28 package BarMeta::Attribute;
29 use base 'Class::MOP::Attribute';
31 package BarMeta::Method;
32 use base 'Class::MOP::Method';
35 use metaclass 'BarMeta' => (
36 'attribute_metaclass' => 'BarMeta::Attribute',
37 'method_metaclass' => 'BarMeta::Method',
41 can_ok('Bar', 'meta');
42 isa_ok(Bar->meta, 'BarMeta');
43 isa_ok(Bar->meta, 'Class::MOP::Class');
45 is(Bar->meta->attribute_metaclass, 'BarMeta::Attribute', '... got the right attribute metaobject');
46 is(Bar->meta->method_metaclass, 'BarMeta::Method', '... got the right method metaobject');
53 can_ok('Baz', 'meta');
54 isa_ok(Baz->meta, 'Class::MOP::Class');
58 metaclass->import('Foo');
60 ok($@, '... metaclasses must be subclass of Class::MOP::Class');