Don't use $_ as loop variable when calling arbitrary code (RT#81072)
[gitmo/Moo.git] / t / no-moo.t
CommitLineData
34a69e36 1use strictures 1;
2use Test::More;
3
4{
5 package Spoon;
6
7 use Moo;
8
9 no warnings 'redefine';
10
11 sub has { "has!" }
12
13 no Moo;
14}
15
108f8ddc 16{
17 package Roller;
18
19 use Moo::Role;
20
21 no warnings 'redefine';
22
23 sub with { "with!" }
24
25 no Moo::Role;
26}
27
34a69e36 28ok(!Spoon->can('extends'), 'extends cleaned');
29is(Spoon->has, "has!", 'has left alone');
30
108f8ddc 31ok(!Roller->can('has'), 'has cleaned');
32is(Roller->with, "with!", 'with left alone');
33
34a69e36 34done_testing;