From: Graham Knop Date: Tue, 18 Dec 2012 13:49:54 +0000 (-0500) Subject: test for Moose consuming a role with no subs after Moo does X-Git-Tag: v1.000008~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=bfe18b3563f95fcf48e463112850f046b47c6938;p=gitmo%2FMoo.git test for Moose consuming a role with no subs after Moo does --- diff --git a/xt/lib/ExampleMooRole.pm b/xt/lib/ExampleMooRole.pm new file mode 100644 index 0000000..3dabe58 --- /dev/null +++ b/xt/lib/ExampleMooRole.pm @@ -0,0 +1,8 @@ +package ExampleMooRole; +use Moo::Role; + +$::ExampleMooRole_LOADED++; + +no Moo::Role; + +1; diff --git a/xt/moose-consume-moo-role-after-consumed-by-moo.t b/xt/moose-consume-moo-role-after-consumed-by-moo.t new file mode 100644 index 0000000..120f96f --- /dev/null +++ b/xt/moose-consume-moo-role-after-consumed-by-moo.t @@ -0,0 +1,21 @@ +use strictures; +use Test::More; +use lib 'xt/lib'; + +BEGIN { $::ExampleMooRole_LOADED = 0 } +BEGIN { + package ExampleMooConsumer; + use Moo; + + with "ExampleMooRole"; +} +BEGIN { + package ExampleMooseConsumer; + use Moose; + + with "ExampleMooRole"; +} + +is $::ExampleMooRole_LOADED, 1, "role loaded only once"; + +done_testing;