6 use Test::More tests => 6;
15 package My::Attribute::Trait;
18 has 'alias_to' => (is => 'ro', isa => 'Str');
20 after 'install_accessors' => sub {
22 $self->associated_class->add_method(
24 $self->get_read_method_ref
28 package Moose::Meta::Attribute::Custom::Trait::Aliased;
29 sub register_implementation { 'My::Attribute::Trait' }
37 traits => [qw/Aliased/],
44 my $c = My::Class->new(bar => 100);
45 isa_ok($c, 'My::Class');
47 is($c->bar, 100, '... got the right value for bar');
50 is($c->baz, 100, '... got the right value for baz');
52 does_ok($c->meta->get_attribute('bar'), 'My::Attribute::Trait');