X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Faccessor-handles.t;h=d96abb84f3c8c95e55f65db37ce6c5f9457ebbd2;hb=2f425b5770149d4ed2e59da001c3be052cbd6bc1;hp=b88a700d3a31c9ba2abad27ab511ade20ce6c5aa;hpb=43a43bffef786b13ac8924ece74f0420fd3421fd;p=gitmo%2FMoo.git diff --git a/t/accessor-handles.t b/t/accessor-handles.t index b88a700..d96abb8 100644 --- a/t/accessor-handles.t +++ b/t/accessor-handles.t @@ -74,4 +74,17 @@ is $bar->eat_curry, 'Curry!', 'handles works for currying'; is $bar->foobot, 'beep', 'asserter checks for existence not truth, on false value'; is $bar->foobar, 'bar', 'asserter checks for existence not truth, on undef '; + +{ + local $@; + ok !eval q{ + package Baz; + use Moo; + has foo => ( is => 'ro', handles => 'Robot' ); + sub smash { 1 }; + 1; + }, 'handles will not overwrite locally defined method'; + like $@, qr{You cannot overwrite a locally defined method \(smash\) with a delegation}; +} + done_testing;