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