Implemented List::sort and Array::sort_in_place. Added basic tests and pod.
[gitmo/MooseX-AttributeHelpers.git] / t / 010_array_from_role.t
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('MooseX::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' => (
23         metaclass => 'Collection::Array',
24         is        => 'ro',
25         isa       => 'ArrayRef[Foo]',
26     );
27     
28     package Bulkie::Role;
29     use Moose::Role;
30
31     has 'stuff' => (
32         metaclass => 'Collection::Array',
33         is        => 'ro',
34         isa       => 'ArrayRef',
35         provides  => {
36             'get' => 'get_stuff'
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 }