5 use Test::More tests => 2;
10 package Bar::Meta::Attribute;
13 extends 'Moose::Meta::Attribute';
15 has 'my_legal_option' => (
20 around legal_options_for_inheritance => sub {
21 return (shift->(@_), qw/my_legal_option/);
28 metaclass => 'Bar::Meta::Attribute',
29 my_legal_option => sub { 'Bar' }
38 my_legal_option => sub { 'Bar::B' }
42 my $bar_attr = Bar::B->meta->get_attribute('bar');
43 my ($legal_option) = grep {
44 $_ eq 'my_legal_option'
45 } $bar_attr->legal_options_for_inheritance;
46 is($legal_option, 'my_legal_option',
47 '... added my_legal_option as legal option for inheritance' );
48 is($bar_attr->my_legal_option->(), 'Bar::B', '... overloaded my_legal_option');