Add a test for attribute conflict when composing one role into another
Dave Rolsky [Wed, 8 Sep 2010 02:00:46 +0000 (21:00 -0500)]
t/030_roles/047_role_attribute_conflict.t [new file with mode: 0644]

diff --git a/t/030_roles/047_role_attribute_conflict.t b/t/030_roles/047_role_attribute_conflict.t
new file mode 100644 (file)
index 0000000..46b3296
--- /dev/null
@@ -0,0 +1,29 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Exception;
+
+{
+    package My::Role1;
+    use Moose::Role;
+
+    has foo => (
+        is => 'ro',
+    );
+
+}
+
+{
+    package My::Role2;
+    use Moose::Role;
+
+    has foo => (
+        is => 'ro',
+    );
+
+    ::throws_ok { with 'My::Role1' } qr/attribute conflict.+My::Role2.+foo/,
+        'attribute conflict when composing one role into another';
+}
+
+done_testing;