show the first line here when testing with a harness
[gitmo/Moose.git] / t / bugs / role_caller.t
1 package MyRole;
2
3 use Moose::Role;
4
5 sub foo { return (caller(0))[3] }
6
7 no Moose::Role;
8
9 package MyClass1; use Moose; with 'MyRole'; no Moose;
10 package MyClass2; use Moose; with 'MyRole'; no Moose;
11
12 package main;
13
14 use Test::More;
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
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" );
26
27 done_testing;