complete re-organization of the test suite
[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
6use Test::More tests => 4;
7use Test::Exception;
8
9BEGIN {
10 use_ok('Moose');
11}
12
13{
14 package My::Custom::Meta::Attr;
15 use Moose;
16
17 extends 'Moose::Meta::Attribute';
18}
19
20{
21 package My::Fancy::Role;
22 use Moose::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 Moose;
34
35 with 'My::Fancy::Role';
36}
37
38my $c = My::Class->new;
39isa_ok($c, 'My::Class');
40
41ok($c->meta->has_attribute('bling_bling'), '... got the attribute');
42
43isa_ok($c->meta->get_attribute('bling_bling'), 'My::Custom::Meta::Attr');
44
45