4 use Test::More tests => 11;
11 use base 'Class::MOP::Class';
14 use metaclass 'FooMeta';
17 can_ok('Foo', 'meta');
18 isa_ok(Foo->meta, 'FooMeta');
19 isa_ok(Foo->meta, 'Class::MOP::Class');
23 use base 'Class::MOP::Class';
25 package BarMeta::Attribute;
26 use base 'Class::MOP::Attribute';
28 package BarMeta::Method;
29 use base 'Class::MOP::Method';
32 use metaclass 'BarMeta' => (
33 'attribute_metaclass' => 'BarMeta::Attribute',
34 'method_metaclass' => 'BarMeta::Method',
38 can_ok('Bar', 'meta');
39 isa_ok(Bar->meta, 'BarMeta');
40 isa_ok(Bar->meta, 'Class::MOP::Class');
42 is(Bar->meta->attribute_metaclass, 'BarMeta::Attribute', '... got the right attribute metaobject');
43 is(Bar->meta->method_metaclass, 'BarMeta::Method', '... got the right method metaobject');
50 can_ok('Baz', 'meta');
51 isa_ok(Baz->meta, 'Class::MOP::Class');
55 metaclass->import('Foo');
57 ok($@, '... metaclasses must be subclass of Class::MOP::Class');