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