From: Hans Dieter Pearcey Date: Thu, 2 Apr 2009 05:27:54 +0000 (-0400) Subject: add TODO test for caller() in role methods X-Git-Tag: 0.73_01~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=392e6804befc0590724b2579a89bf3c3b4cae971;p=gitmo%2FMoose.git add TODO test for caller() in role methods --- diff --git a/t/030_roles/032_roles_and_method_cloning.t b/t/030_roles/032_roles_and_method_cloning.t index d167ec1..edaf281 100644 --- a/t/030_roles/032_roles_and_method_cloning.t +++ b/t/030_roles/032_roles_and_method_cloning.t @@ -3,14 +3,14 @@ use strict; use warnings; -use Test::More tests => 14; +use Test::More tests => 16; { package Role::Foo; use Moose::Role; - sub foo { } + sub foo { (caller(0))[3] } } { @@ -70,3 +70,10 @@ use Test::More tests => 14; is( $meth->original_fully_qualified_name, 'Role::Foo::foo', 'original fq name is Role::Foo::foo' ); } + +is( ClassB->foo, 'ClassB::foo', 'ClassB::foo knows its name' ); +{ + local $TODO = + "multiply-consumed roles' subs take on their most recently used name"; + is( ClassA->foo, 'ClassA::foo', 'ClassA::foo knows its name' ); +}