Commit | Line | Data |
---|---|---|
e3c07b19 | 1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
a5209c26 | 6 | use Test::More tests => 2; |
e3c07b19 | 7 | use Test::Exception; |
8 | ||
e3c07b19 | 9 | { |
10 | package Foo; | |
11 | use Moose; | |
12 | ||
d50fc84a | 13 | has 'bar' => ( is => 'rw' ); |
e3c07b19 | 14 | |
15 | package Stuffed::Role; | |
16 | use Moose::Role; | |
17 | ||
18 | has 'options' => ( | |
a40b446a | 19 | traits => ['Array'], |
d50fc84a | 20 | is => 'ro', |
21 | isa => 'ArrayRef[Foo]', | |
e3c07b19 | 22 | ); |
23 | ||
24 | package Bulkie::Role; | |
25 | use Moose::Role; | |
26 | ||
27 | has 'stuff' => ( | |
a40b446a | 28 | traits => ['Array'], |
d50fc84a | 29 | is => 'ro', |
30 | isa => 'ArrayRef', | |
31 | handles => { | |
c13596ce | 32 | get_stuff => 'get', |
e3c07b19 | 33 | } |
34 | ); | |
35 | ||
36 | package Stuff; | |
37 | use Moose; | |
38 | ||
d50fc84a | 39 | ::lives_ok{ with 'Stuffed::Role'; |
40 | } '... this should work correctly'; | |
e3c07b19 | 41 | |
d50fc84a | 42 | ::lives_ok{ with 'Bulkie::Role'; |
43 | } '... this should work correctly'; | |
e3c07b19 | 44 | } |