as requested by rafl
Hans Dieter Pearcey [Sat, 28 Feb 2009 15:19:06 +0000 (15:19 +0000)]
t/100_bugs/022_role_caller.t [new file with mode: 0644]

diff --git a/t/100_bugs/022_role_caller.t b/t/100_bugs/022_role_caller.t
new file mode 100644 (file)
index 0000000..69988c3
--- /dev/null
@@ -0,0 +1,21 @@
+package MyRole;
+
+use Moose::Role;
+
+sub foo { return (caller(0))[3] }
+
+no Moose::Role;
+
+package MyClass1; use Moose; with 'MyRole'; no Moose;
+package MyClass2; use Moose; with 'MyRole'; no Moose;
+
+package main;
+
+use Test::More tests => 2;
+
+{
+  local $TODO = 'for rafl';
+  is(MyClass1->foo, 'MyClass1::foo',
+    'method from role has correct name in caller()');
+}
+is(MyClass2->foo, 'MyClass2::foo');