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