'Fix' has '+attr' in roles by exploding earlier.
[gitmo/Moose.git] / t / 030_roles / 017_extending_role_attrs.t
index df01d3d..c34d9c9 100644 (file)
@@ -3,11 +3,10 @@
 use strict;
 use warnings;
 
-use Test::More tests => 27;
+use Test::More;
 use Test::Exception;
 
 
-
 =pod
 
 This basically just makes sure that using +name
@@ -151,6 +150,7 @@ is_deeply($quux->quux, ["hi"], "... still has the old ArrayRef value");
     for (1..3) {
         has "err$_" => (
             isa => 'Str | Int',
+            is => 'bare',
         );
     }
 
@@ -172,3 +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;