From: Matt S Trout Date: Tue, 26 Jun 2012 18:35:06 +0000 (+0000) Subject: piss off. -- mst X-Git-Tag: v0.091010~14 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=34a69e36826582e95f8a31215f6dff570b1bddc6;p=gitmo%2FMoo.git piss off. -- mst --- diff --git a/Changes b/Changes index 206c656..509755d 100644 --- a/Changes +++ b/Changes @@ -1,3 +1,4 @@ + - squelch used only once warnings for $Moo::HandleMoose::MOUSE - MooClass->meta - subconstructor handling for Moose classes diff --git a/lib/Moo.pm b/lib/Moo.pm index 2034459..51f0dc6 100644 --- a/lib/Moo.pm +++ b/lib/Moo.pm @@ -26,6 +26,7 @@ sub import { Moo->_constructor_maker_for($target) ->register_attribute_specs(%{$old->all_attribute_specs}); } + no warnings 'once'; # piss off. -- mst $Moo::HandleMoose::MOUSE{$target} = [ grep defined, map Mouse::Util::find_meta($_), @_ ] if $INC{"Mouse.pm"}; diff --git a/t/no-moo.t b/t/no-moo.t new file mode 100644 index 0000000..c857ef4 --- /dev/null +++ b/t/no-moo.t @@ -0,0 +1,19 @@ +use strictures 1; +use Test::More; + +{ + package Spoon; + + use Moo; + + no warnings 'redefine'; + + sub has { "has!" } + + no Moo; +} + +ok(!Spoon->can('extends'), 'extends cleaned'); +is(Spoon->has, "has!", 'has left alone'); + +done_testing;