Commit | Line | Data |
---|---|---|
e71272cf | 1 | use strict; |
2 | use warnings FATAL => 'all'; | |
471419f6 | 3 | use Test::More; |
4 | use Test::Fatal; | |
5 | ||
6 | { | |
7 | package R1; | |
8 | use Role::Tiny; | |
9 | ||
10 | sub foo {} | |
11 | ||
12 | $INC{"R1.pm"} = __FILE__; | |
13 | } | |
14 | ||
15 | { | |
16 | package R2; | |
17 | use Role::Tiny; | |
18 | ||
19 | sub foo {} | |
20 | ||
21 | $INC{"R2.pm"} = __FILE__; | |
22 | } | |
23 | ||
24 | { | |
25 | package X; | |
26 | sub new { | |
27 | bless {} => shift | |
28 | } | |
29 | } | |
30 | ||
31 | ok(exception { Role::Tiny->apply_roles_to_object(X->new, "R1", "R2") }, 'apply conflicting roles to object'); | |
32 | ||
33 | done_testing; |