From: Graham Knop Date: Tue, 18 Dec 2012 13:49:45 +0000 (-0500) Subject: test for use Moo after no Moo X-Git-Tag: v1.000008~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=gitmo%2FMoo.git;a=commitdiff_plain;h=69b3967115d4e8659d52e993a788e7b8c669adf7 test for use Moo after no Moo --- diff --git a/t/use-after-no.t b/t/use-after-no.t new file mode 100644 index 0000000..5ced7df --- /dev/null +++ b/t/use-after-no.t @@ -0,0 +1,40 @@ +use strictures 1; +use Test::More; + +ok eval q{ + package Spoon; + use Moo; + + has foo => ( is => 'ro' ); + + no Moo; + + use Moo; + + has foo2 => ( is => 'ro' ); + + no Moo; + + 1; +}, "subs imported on 'use Moo;' after 'no Moo;'" + or diag $@; + +ok eval q{ + package Roller; + use Moo; + + has foo => ( is => 'ro' ); + + no Moo; + + use Moo; + + has foo2 => ( is => 'ro' ); + + no Moo; + + 1; +}, "subs imported on 'use Moo::Role;' after 'no Moo::Role;'" + or diag $@; + +done_testing;