Don't use $_ as loop variable when calling arbitrary code (RT#81072)
[gitmo/Moo.git] / xt / moose-override-attribute-with-plus-syntax.t
index e4b90c3..fb3c31e 100644 (file)
@@ -21,6 +21,16 @@ use Test::Fatal;
         default => 'MooseChild',
     );
 }
+{
+    package MooseChild2;
+    use Moose;
+    extends 'MooParent';
+
+    has '+foo' => (
+        default => 'MooseChild2',
+    );
+    __PACKAGE__->meta->make_immutable
+}
 
 is(
     MooseChild->new->foo,
@@ -28,5 +38,11 @@ is(
     'default value in Moose child'
 );
 
+is(
+    MooseChild2->new->foo,
+    'MooseChild2',
+    'default value in Moose child'
+);
+
 done_testing;