Update tests
[gitmo/Mouse.git] / t / 050_metaclasses / 001_custom_attr_meta_with_roles.t
CommitLineData
4060c871 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
6use Test::More tests => 3;
7use 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
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