Another broken case where Moo::Role, then namespace::autoclean get loaded
Tomas Doran [Mon, 7 May 2012 15:03:57 +0000 (16:03 +0100)]
xt/lib/ExampleMooRoleWithAttribute.pm [new file with mode: 0644]
xt/moo-roles-into-moose-class-attr-override-with-autoclean.t [new file with mode: 0644]

diff --git a/xt/lib/ExampleMooRoleWithAttribute.pm b/xt/lib/ExampleMooRoleWithAttribute.pm
new file mode 100644 (file)
index 0000000..a1f1884
--- /dev/null
@@ -0,0 +1,12 @@
+package ExampleMooRoleWithAttribute;;
+use Moo::Role;
+# Note that autoclean here is the key bit!
+use namespace::autoclean;
+
+has output_to => (
+    is => 'ro',
+    required => 1,
+);
+
+1;
+
diff --git a/xt/moo-roles-into-moose-class-attr-override-with-autoclean.t b/xt/moo-roles-into-moose-class-attr-override-with-autoclean.t
new file mode 100644 (file)
index 0000000..cccb7d1
--- /dev/null
@@ -0,0 +1,23 @@
+use strict;
+use warnings;
+use Test::More;
+use FindBin qw/ $Bin /;
+use lib "$Bin/lib";
+
+{
+    package Bax;
+    use Moose;
+
+    with qw/
+        ExampleMooRoleWithAttribute
+    /;
+
+
+    has '+output_to' => (
+        required => 1,
+    );
+}
+
+ok 1;
+done_testing;
+