Commit | Line | Data |
---|---|---|
ac0ece3d | 1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
a28e50e4 | 6 | use Test::More; |
ac0ece3d | 7 | |
7ff56534 | 8 | |
ac0ece3d | 9 | { |
10 | package My::Custom::Meta::Attr; | |
11 | use Moose; | |
d03bd989 | 12 | |
ac0ece3d | 13 | extends 'Moose::Meta::Attribute'; |
14 | } | |
15 | ||
16 | { | |
17 | package My::Fancy::Role; | |
18 | use Moose::Role; | |
d03bd989 | 19 | |
ac0ece3d | 20 | has 'bling_bling' => ( |
21 | metaclass => 'My::Custom::Meta::Attr', | |
22 | is => 'rw', | |
23 | isa => 'Str', | |
24 | ); | |
25 | } | |
26 | ||
27 | { | |
28 | package My::Class; | |
29 | use Moose; | |
d03bd989 | 30 | |
ac0ece3d | 31 | with 'My::Fancy::Role'; |
32 | } | |
33 | ||
34 | my $c = My::Class->new; | |
35 | isa_ok($c, 'My::Class'); | |
36 | ||
37 | ok($c->meta->has_attribute('bling_bling'), '... got the attribute'); | |
38 | ||
39 | isa_ok($c->meta->get_attribute('bling_bling'), 'My::Custom::Meta::Attr'); | |
40 | ||
a28e50e4 | 41 | done_testing; |