X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F003_inheriting_meta_desc.t;h=0419d3a7de98640e83be49783621bd761fc33ffa;hb=cde3f91b782855c0cb919a9b43df86118d98914e;hp=a4ced5a9a03b9f21422ab57e23c25029413d940f;hpb=fb835cf8090355016bc595ddf82d317086764f5d;p=gitmo%2FMooseX-MetaDescription.git diff --git a/t/003_inheriting_meta_desc.t b/t/003_inheriting_meta_desc.t index a4ced5a..0419d3a 100644 --- a/t/003_inheriting_meta_desc.t +++ b/t/003_inheriting_meta_desc.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More no_plan => 1; +use Test::More 'no_plan'; use Test::Exception; BEGIN { @@ -13,32 +13,32 @@ BEGIN { { package Foo; use Moose; - + has 'bar' => ( metaclass => 'MooseX::MetaDescription::Meta::Attribute', is => 'ro', - isa => 'Str', + isa => 'Str', default => sub { 'Foo::bar' }, description => { baz => 'Foo::bar::baz', gorch => 'Foo::bar::gorch', } - ); - + ); + has 'baz' => ( traits => [ 'MooseX::MetaDescription::Meta::Trait' ], is => 'ro', - isa => 'Str', + isa => 'Str', default => sub { 'Foo::baz' }, description => { bar => 'Foo::baz::bar', gorch => 'Foo::baz::gorch', } - ); - + ); + package Bar; use Moose; - + extends 'Foo'; } @@ -53,20 +53,20 @@ isa_ok($baz_attr->metadescription, 'MooseX::MetaDescription::Description'); is($baz_attr->metadescription->descriptor, $baz_attr, '... got the circular ref'); { - + my $bar_attr = Bar->meta->find_attribute_by_name('bar'); - - can_ok($bar_attr, 'description'); + + can_ok($bar_attr, 'description'); isa_ok($bar_attr->metadescription, 'MooseX::MetaDescription::Description'); is($bar_attr->metadescription->descriptor, $bar_attr, '... got the circular ref'); - + my $baz_attr = Bar->meta->find_attribute_by_name('baz'); - - can_ok($baz_attr, 'description'); + + can_ok($baz_attr, 'description'); isa_ok($baz_attr->metadescription, 'MooseX::MetaDescription::Description'); is($baz_attr->metadescription->descriptor, $baz_attr, '... got the circular ref'); - - my ($bar_attr_2, $baz_attr_2) = Bar->meta->compute_all_applicable_attributes; + + my ($bar_attr_2, $baz_attr_2) = Bar->meta->get_all_attributes; is($bar_attr, $bar_attr_2, '... got the same attribute'); is($baz_attr, $baz_attr_2, '... got the same attribute'); } @@ -92,4 +92,4 @@ foreach my $foo ('Foo', Foo->new, 'Bar', Bar->new) { }, '... got the right class description' ); -} \ No newline at end of file +}