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