Commit | Line | Data |
bdef60b4 |
1 | use Test::More tests => 4; |
2 | |
4c98ebb0 |
3 | package MyRole; |
4 | |
5 | use Mouse::Role; |
6 | |
7 | sub foo { return (caller(0))[3] } |
8 | |
9 | no Mouse::Role; |
10 | |
11 | package MyClass1; use Mouse; with 'MyRole'; no Mouse; |
12 | package MyClass2; use Mouse; with 'MyRole'; no Mouse; |
13 | |
14 | package main; |
15 | |
4c98ebb0 |
16 | { |
17 | local $TODO = 'Role composition does not clone methods yet'; |
18 | is(MyClass1->foo, 'MyClass1::foo', |
19 | 'method from role has correct name in caller()'); |
20 | is(MyClass2->foo, 'MyClass2::foo', |
21 | 'method from role has correct name in caller()'); |
22 | } |
23 | |
24 | isnt(MyClass1->foo, "MyClass2::foo", "role method is not confused with other class" ); |
25 | isnt(MyClass2->foo, "MyClass1::foo", "role method is not confused with other class" ); |