X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=xt%2Fmoo-does-moose-role.t;h=4e4fa10892b3c2d40655694a13f1742c2b2e850d;hb=ef4ff8da82d5b2c2635da073084ad2a14b4d2050;hp=38472870cebe70d5645f34082f619b0c1bdc4576;hpb=eb100447a7447ba6620bff6e246d5fc86ecd2c7c;p=gitmo%2FMoo.git diff --git a/xt/moo-does-moose-role.t b/xt/moo-does-moose-role.t index 3847287..4e4fa10 100644 --- a/xt/moo-does-moose-role.t +++ b/xt/moo-does-moose-role.t @@ -175,6 +175,23 @@ BEGIN { extends 'Plank'; } +BEGIN { + package Plonk; + use Moo; + has kk => (is => 'rw', moosify => [sub { + $_[0]->{documentation} = 'parent'; + }]); +} +BEGIN { + package Plonker; + use Moo; + extends 'Plonk'; + has '+kk' => (moosify => sub { + my $spec = shift; + $spec->{documentation} .= 'child'; + }); +} + foreach my $s ( Splattered->new, Splattered2->new, @@ -203,9 +220,11 @@ foreach my $c (qw/ ok $c->can('has_splat'); } -foreach my $c (Plunker->new) { - is(Plunker->meta->find_attribute_by_name('pp')->documentation, 'moosify', 'moosify modifies attr specs'); - is(Planker->meta->find_attribute_by_name('vv')->documentation, 'moosify foo', 'moosify modifies attr specs as array'); -} +is(Plunker->meta->find_attribute_by_name('pp')->documentation, 'moosify', 'moosify modifies attr specs'); +is(Planker->meta->find_attribute_by_name('vv')->documentation, 'moosify foo', 'moosify modifies attr specs as array'); + +is( Plonker->meta->find_attribute_by_name('kk')->documentation, + 'parentchild', + 'moosify applies for overridden attributes with roles'); done_testing;