Support modifier by regexp
[gitmo/Mouse.git] / t / 100_bugs / 022_role_caller.t
CommitLineData
4c98ebb0 1package MyRole;
2
3use Mouse::Role;
4
5sub foo { return (caller(0))[3] }
6
7no Mouse::Role;
8
9package MyClass1; use Mouse; with 'MyRole'; no Mouse;
10package MyClass2; use Mouse; with 'MyRole'; no Mouse;
11
12package main;
13
14use Test::More tests => 4;
15
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
24isnt(MyClass1->foo, "MyClass2::foo", "role method is not confused with other class" );
25isnt(MyClass2->foo, "MyClass1::foo", "role method is not confused with other class" );