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