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
34 traits => [qw/My::Attribute::Trait/],
41 my $c = My::Class->new(bar => 100);
42 isa_ok($c, 'My::Class');
44 is($c->bar, 100, '... got the right value for bar');
47 is($c->baz, 100, '... got the right value for baz');
49 does_ok($c->meta->get_attribute('bar'), 'My::Attribute::Trait');