From: Robert Buels Date: Mon, 22 Jun 2009 14:10:50 +0000 (-0700) Subject: added failing test for Moose::Meta::Role::get_*_method_modifiers empty bug X-Git-Tag: 0.84~25^2~1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c8c3908437b95bf62c4f8d0c42f87f7fdeed386;p=gitmo%2FMoose.git added failing test for Moose::Meta::Role::get_*_method_modifiers empty bug --- diff --git a/t/030_roles/041_empty_method_modifiers_meta_bug.t b/t/030_roles/041_empty_method_modifiers_meta_bug.t new file mode 100644 index 0000000..aacbeb3 --- /dev/null +++ b/t/030_roles/041_empty_method_modifiers_meta_bug.t @@ -0,0 +1,29 @@ +#!/usr/bin/perl +use strict; +use warnings; +use English; + +use Test::More tests => 6; + +# test role and class +package SomeRole; +use Moose::Role; + +requires 'foo'; + +package SomeClass; +use Moose; +has 'foo' => (is => 'rw'); +with 'SomeRole'; + +package main; + +#my $c = SomeClass->new; +#isa_ok( $c, 'SomeClass'); + +for my $modifier_type (qw[ before around after ]) { + my $get_func = "get_${modifier_type}_method_modifiers"; + my @mms = eval{ SomeRole->meta->$get_func('foo') }; + is($@, '', "$get_func for no method mods does not die"); + is(scalar(@mms),0,'is an empty list'); +}