'Fix' has '+attr' in roles by exploding earlier.
[gitmo/Moose.git] / t / 030_roles / 017_extending_role_attrs.t
index b475be3..c34d9c9 100644 (file)
@@ -172,4 +172,16 @@ is_deeply($quux->quux, ["hi"], "... still has the old ArrayRef value");
     } "or add new types to the union";
 }
 
+{
+    package Role::With::PlusAttr;
+    use Moose::Role;
+
+    with 'Foo::Role';
+
+    ::throws_ok {
+        has '+bar' => ( is => 'ro' );
+    } qr/has '\+attr' is not supported in roles/,
+        "Test has '+attr' in roles explodes";
+}
+
 done_testing;