added TODO test for +attribute in a role that composes over another role
Rafael Kitover [Tue, 9 Jun 2009 23:09:49 +0000 (16:09 -0700)]
t/100_bugs/027_compose_over_attribute.t [new file with mode: 0644]

diff --git a/t/100_bugs/027_compose_over_attribute.t b/t/100_bugs/027_compose_over_attribute.t
new file mode 100644 (file)
index 0000000..215bd8f
--- /dev/null
@@ -0,0 +1,31 @@
+use strict;
+use warnings;
+
+use Test::More tests => 2;
+use Test::Exception;
+
+{
+    package BaseRole;
+    use Moose::Role;
+    has foo => (is => 'ro');
+}
+
+TODO: {
+    local $TODO = '+attributes in roles that compose over other roles';
+
+    eval q{
+        package ChildRole;
+        use Moose::Role;
+        with 'BaseRole';
+        has '+foo' => (default => 'bar');
+
+        package AClass;
+        use Moose;
+        with 'ChildRole';
+    };
+
+    ok( (not $@), '+attribute created in child role' );
+
+    is eval{ AClass->new->foo }, 'bar',
+        '+attribute in child role works correctly';
+}