4 use Test::More tests => 4;
7 package My::Attribute::Trait;
12 scalar reverse $self->name;
22 'My::Attribute::Trait' => {
24 reversed_name => 'eman',
33 package My::Other::Class;
38 'My::Attribute::Trait' => {
40 reversed_name => 'reversed',
48 my $attr = My::Class->meta->get_attribute('foo');
49 is($attr->eman, 'oof', 'the aliased method is in the attribute');
50 ok(!$attr->can('reversed'), "the method was not installed under the other class' alias");
52 my $other_attr = My::Other::Class->meta->get_attribute('foo');
53 is($other_attr->reversed, 'oof', 'the aliased method is in the attribute');
54 ok(!$other_attr->can('enam'), "the method was not installed under the other class' alias");