From: gfx Date: Tue, 15 Sep 2009 09:25:50 +0000 (+0900) Subject: Make $role->get_method_list() include meta() (Moose 0.90 feature) X-Git-Tag: 0.32~54^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8a168350bb0fea8bdae0034bc89fcdbe81f85ddc;p=gitmo%2FMouse.git Make $role->get_method_list() include meta() (Moose 0.90 feature) --- diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index e132488..4910f72 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -65,7 +65,7 @@ sub get_method_list { no strict 'refs'; # Get all the CODE symbol table entries my @functions = - grep !/^(?:has|with|around|before|after|augment|inner|override|super|blessed|extends|confess|excludes|meta|requires)$/, + grep !/^(?:has|with|around|before|after|augment|inner|override|super|blessed|extends|confess|excludes|requires)$/, grep { defined &{"${name}::$_"} } keys %{"${name}::"}; wantarray ? @functions : \@functions; diff --git a/t/030_roles/002_role.t b/t/030_roles/002_role.t index 96ead79..448d492 100755 --- a/t/030_roles/002_role.t +++ b/t/030_roles/002_role.t @@ -70,7 +70,7 @@ isa_ok($foo_role->get_method('boo'), 'Mouse::Meta::Role::Method'); is_deeply( [ sort $foo_role->get_method_list() ], - [ 'boo', 'foo' ], + [ 'boo', 'foo', 'meta' ], '... got the right method list'); ok(FooRole->can('foo'), "locally defined methods are still there"); diff --git a/t/800_shikabased/013-compatibility-get_method_list.t b/t/800_shikabased/013-compatibility-get_method_list.t index 41d886e..1fd9a2f 100644 --- a/t/800_shikabased/013-compatibility-get_method_list.t +++ b/t/800_shikabased/013-compatibility-get_method_list.t @@ -32,6 +32,6 @@ sub test { die $@ if $@; is join(',', sort "${class}Class"->meta->get_method_list()), 'foo,meta', "mutable $class"; is join(',', sort "${class}ClassImm"->meta->get_method_list()), 'DESTROY,foo,meta,new', "immutable $class"; - is join(',', sort "${class}Role"->meta->get_method_list()), 'bar', "role $class"; + is join(',', sort "${class}Role"->meta->get_method_list()), 'bar,meta', "role $class"; }