Let the user know which constraint they have violated in the confessed message
[gitmo/MooseX-AttributeHelpers.git] / t / 010_array_from_role.t
CommitLineData
9810162d 1#!/usr/bin/perl
2
3use strict;
4use warnings;
5
9a976497 6use Test::More tests => 3;
9810162d 7use Test::Exception;
8
9BEGIN {
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}