From: Hans Dieter Pearcey Date: Fri, 12 Oct 2007 01:58:58 +0000 (+0000) Subject: add test that fails in 0.26; roles' require() should be able to find real methods... X-Git-Tag: 0_27~30 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3dd18b73b0eef61fce0629b3257486f00a752918;p=gitmo%2FMoose.git add test that fails in 0.26; roles' require() should be able to find real methods in superclasses, even when 'hidden' by method modifiers in subclasses --- diff --git a/t/030_roles/007_roles_and_required_method_edge_cases.t b/t/030_roles/007_roles_and_required_method_edge_cases.t index f957530..304fab1 100644 --- a/t/030_roles/007_roles_and_required_method_edge_cases.t +++ b/t/030_roles/007_roles_and_required_method_edge_cases.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Test::More tests => 18; +use Test::More tests => 19; use Test::Exception; =pod @@ -239,5 +239,27 @@ method modifier. } '... our role combined successfully'; } +# a method required in a role and implemented in a superclass, with a method +# modifier in the subclass. this should live, but dies in 0.26 -- hdp, +# 2007-10-11 +{ + package Bar::Class::Base; + use Moose; + sub bar { "hello!" } +} +{ + package Bar::Role; + use Moose::Role; + requires 'bar'; +} +{ + package Bar::Class::Child; + use Moose; + extends 'Bar::Class::Base'; + after bar => sub { "o noes" }; + ::lives_ok { + with 'Bar::Role'; + } 'required method exists in superclass as non-modifier, so we live'; +}