Commit | Line | Data |
f7f5e02d |
1 | use strictures 1; |
2 | use Test::More; |
3 | |
4 | { |
5 | package RoleOne; |
6 | use Moose::Role; |
7 | |
8 | has foo => ( is => 'rw' ); |
9 | } |
10 | |
11 | { |
12 | package RoleTwo; |
13 | use Moose::Role; |
14 | |
15 | has bar => ( is => 'rw' ); |
16 | } |
17 | |
18 | { |
19 | package SomeClass; |
20 | use Moo; |
21 | |
22 | with 'RoleOne', 'RoleTwo'; |
23 | } |
24 | |
25 | my $i = SomeClass->new( foo => 'bar', bar => 'baz' ); |
26 | is $i->foo, 'bar', "attribute from first role is correct"; |
27 | is $i->bar, 'baz', "attribute from second role is correct"; |
28 | |
29 | done_testing; |
30 | |