6 use Test::More no_plan => 1;
10 use_ok('MooseX::MetaDescription');
15 use metaclass 'MooseX::MetaDescription::Meta::Class';
18 __PACKAGE__->meta->description->{'Hello'} = 'World';
21 metaclass => 'MooseX::MetaDescription::Meta::Attribute',
24 default => sub { 'Foo::bar' },
26 baz => 'Foo::bar::baz',
27 gorch => 'Foo::bar::gorch',
32 traits => [ 'MooseX::MetaDescription::Meta::Attribute::Trait' ],
35 default => sub { 'Foo::baz' },
37 bar => 'Foo::baz::bar',
38 gorch => 'Foo::baz::gorch',
45 my $foo_class = Foo->meta;
46 is($foo_class->metadescription->class, $foo_class, '... got the circular ref');
48 my $bar_attr = Foo->meta->get_attribute('bar');
49 is($bar_attr->metadescription->attribute, $bar_attr, '... got the circular ref');
51 my $baz_attr = Foo->meta->get_attribute('baz');
52 is($baz_attr->metadescription->attribute, $baz_attr, '... got the circular ref');
54 # check the actual descs
56 foreach my $foo ('Foo', Foo->new) {
58 $foo->meta->description,
59 { 'Hello' => 'World' },
60 '... got the right class description'
64 $foo->meta->get_attribute('bar')->description,
66 baz => 'Foo::bar::baz',
67 gorch => 'Foo::bar::gorch',
69 '... got the right class description'
73 $foo->meta->get_attribute('baz')->description,
75 bar => 'Foo::baz::bar',
76 gorch => 'Foo::baz::gorch',
78 '... got the right class description'