runtime applied roles include roles from original class in new class
[gitmo/Role-Tiny.git] / t / role-tiny-composition.t
CommitLineData
471419f6 1use strictures 1;
2use Test::More;
3use Test::Fatal;
4
5{
6 package R1;
7 use Role::Tiny;
8
9 sub foo {}
10
11 $INC{"R1.pm"} = __FILE__;
12}
13
14{
15 package R2;
16 use Role::Tiny;
17
18 sub foo {}
19
20 $INC{"R2.pm"} = __FILE__;
21}
22
23{
24 package X;
25 sub new {
26 bless {} => shift
27 }
28}
29
30ok(exception { Role::Tiny->apply_roles_to_object(X->new, "R1", "R2") }, 'apply conflicting roles to object');
31
32done_testing;