Commit | Line | Data |
---|---|---|
e3c07b19 | 1 | #!/usr/bin/perl |
2 | ||
3 | use strict; | |
4 | use warnings; | |
5 | ||
a28e50e4 | 6 | use Test::More; |
53a4d826 | 7 | use Test::Exception; |
e3c07b19 | 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 | ||
53a4d826 | 39 | ::lives_ok{ with 'Stuffed::Role'; |
40 | } '... this should work correctly'; | |
e3c07b19 | 41 | |
53a4d826 | 42 | ::lives_ok{ with 'Bulkie::Role'; |
43 | } '... this should work correctly'; | |
e3c07b19 | 44 | } |
a28e50e4 | 45 | |
46 | done_testing; |