remove trailing whitespace
[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
7ff56534 6use Test::More tests => 3;
ac0ece3d 7use Test::Exception;
8
7ff56534 9
ac0ece3d 10
11{
12 package My::Custom::Meta::Attr;
13 use Moose;
d03bd989 14
ac0ece3d 15 extends 'Moose::Meta::Attribute';
16}
17
18{
19 package My::Fancy::Role;
20 use Moose::Role;
d03bd989 21
ac0ece3d 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 Moose;
d03bd989 32
ac0ece3d 33 with 'My::Fancy::Role';
34}
35
36my $c = My::Class->new;
37isa_ok($c, 'My::Class');
38
39ok($c->meta->has_attribute('bling_bling'), '... got the attribute');
40
41isa_ok($c->meta->get_attribute('bling_bling'), 'My::Custom::Meta::Attr');
42
43