X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2Fno-moo.t;h=0388a2badb5d845b1c5b7a9ce8d17a363e064c73;hb=f1bad247e7bea8015d4d57f66c7e033b52d513a4;hp=74ed54e6d64889d6eadc39c4114cefd602155096;hpb=a6e16bfbdf3d270753d3c37945d22211e70a2abd;p=gitmo%2FMoo.git diff --git a/t/no-moo.t b/t/no-moo.t index 74ed54e..0388a2b 100644 --- a/t/no-moo.t +++ b/t/no-moo.t @@ -69,6 +69,19 @@ use Test::More; main::is_deeply(\%stash, \%stash2, "stash of non-Moo role remains untouched"); } +{ + package GlobalConflict2; + + use Moo; + + no warnings 'redefine'; + + our $after = "has!"; + sub has { $after } + + no Moo; +} + ok(!Spoon->can('extends'), 'extends cleaned'); is(Spoon->has, "has!", 'has left alone'); @@ -87,4 +100,11 @@ is(GlobalConflict->has, "has!", 'has left alone'); ok(RollerTiny->can('around'), 'around left alone'); is(RollerTiny->with, "with!", 'with left alone'); +ok(!GlobalConflict2->can('extends'), 'extends cleaned'); +is(GlobalConflict2->has, "has!", 'has left alone'); +{ + no warnings 'once'; + is($GlobalConflict2::after, "has!", 'package global left alone'); +} + done_testing;