Mouse::Util::does_role() respects $thing->does() method
[gitmo/Mouse.git] / t / 050_metaclasses / 001_custom_attr_meta_with_roles.t
1 #!/usr/bin/perl
2 # This is automatically generated by author/import-moose-test.pl.
3 # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!!
4 use t::lib::MooseCompat;
5
6 use strict;
7 use warnings;
8
9 use Test::More;
10 use Test::Exception;
11
12
13 {
14     package My::Custom::Meta::Attr;
15     use Mouse;
16
17     extends 'Mouse::Meta::Attribute';
18 }
19
20 {
21     package My::Fancy::Role;
22     use Mouse::Role;
23
24     has 'bling_bling' => (
25         metaclass => 'My::Custom::Meta::Attr',
26         is        => 'rw',
27         isa       => 'Str',
28     );
29 }
30
31 {
32     package My::Class;
33     use Mouse;
34
35     with 'My::Fancy::Role';
36 }
37
38 my $c = My::Class->new;
39 isa_ok($c, 'My::Class');
40
41 ok($c->meta->has_attribute('bling_bling'), '... got the attribute');
42
43 isa_ok($c->meta->get_attribute('bling_bling'), 'My::Custom::Meta::Attr');
44
45 done_testing;