4 use Test::More tests => 6;
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_name'), 'the method was not installed under its original name');
49 ok(!$attr->can('reversed'), "the method was not installed under the other class' alias");
51 my $other_attr = My::Other::Class->meta->get_attribute('foo');
52 is($other_attr->reversed, 'oof', 'the aliased method is in the attribute');
53 ok(!$other_attr->can('reversed_name'), 'the method was not installed under its original name');
54 ok(!$other_attr->can('enam'), "the method was not installed under the other class' alias");