Commit | Line | Data |
4c98ebb0 |
1 | package MyRole; |
fde8e43f |
2 | # This is automatically generated by author/import-moose-test.pl. |
3 | # DO NOT EDIT THIS FILE. ANY CHANGES WILL BE LOST!!! |
4 | use t::lib::MooseCompat; |
4c98ebb0 |
5 | |
6 | use Mouse::Role; |
7 | |
8 | sub foo { return (caller(0))[3] } |
9 | |
10 | no Mouse::Role; |
11 | |
12 | package MyClass1; use Mouse; with 'MyRole'; no Mouse; |
13 | package MyClass2; use Mouse; with 'MyRole'; no Mouse; |
14 | |
15 | package main; |
16 | |
fde8e43f |
17 | use Test::More; |
18 | |
4c98ebb0 |
19 | { |
20 | local $TODO = 'Role composition does not clone methods yet'; |
21 | is(MyClass1->foo, 'MyClass1::foo', |
22 | 'method from role has correct name in caller()'); |
23 | is(MyClass2->foo, 'MyClass2::foo', |
24 | 'method from role has correct name in caller()'); |
25 | } |
26 | |
27 | isnt(MyClass1->foo, "MyClass2::foo", "role method is not confused with other class" ); |
28 | isnt(MyClass2->foo, "MyClass1::foo", "role method is not confused with other class" ); |
fde8e43f |
29 | |
30 | done_testing; |