6 use Test::More no_plan => 1;
10 use_ok('MooseX::MetaDescription');
18 traits => [ 'MooseX::MetaDescription::Meta::Trait' ],
21 default => sub { 'Foo::baz' },
23 bar => 'Foo::baz::bar',
24 gorch => 'Foo::baz::gorch',
36 my $baz_attr = Foo->meta->find_attribute_by_name('baz');
37 isa_ok($baz_attr->metadescription, 'MooseX::MetaDescription::Description');
38 is($baz_attr->metadescription->descriptor, $baz_attr, '... got the circular ref');
41 my $baz_attr = Bar->meta->find_attribute_by_name('baz');
42 can_ok($baz_attr, 'description');
43 isa_ok($baz_attr->metadescription, 'MooseX::MetaDescription::Description');
44 is($baz_attr->metadescription->descriptor, $baz_attr, '... got the circular ref');
46 my ($baz_attr_2) = Bar->meta->compute_all_applicable_attributes;
47 is($baz_attr, $baz_attr_2, '... got the same attribute');
50 # check the actual descs
52 foreach my $foo ('Foo', Foo->new, 'Bar', Bar->new) {
55 $foo->meta->find_attribute_by_name('baz')->description,
57 bar => 'Foo::baz::bar',
58 gorch => 'Foo::baz::gorch',
60 '... got the right class description'