new failing test case for method conflict detection in roles topic/role_application_conflict_failure
Karen Etheridge [Wed, 25 Apr 2012 21:23:04 +0000 (14:23 -0700)]
t/roles/role_conflict_edge_cases.t

index 4a6cee7..a833646 100644 (file)
@@ -187,4 +187,39 @@ ok(My::Test::Class4->meta->has_attribute('foo'), '... have the attribute foo as
 
 is(My::Test::Class4->new->foo, 'Role::Base::foo', '... got the right value from method');
 
+
+TODO:
+{
+    {
+        package Failing::Z;
+        use Moose::Role;
+    }
+    {
+        package Failing::A;
+        use Moose::Role;
+        sub foo { 'A' }
+    }
+    {
+        package Failing::B;
+        use Moose::Role;
+        with 'Failing::A';
+        sub foo { 'B' }
+    }
+    {
+        package Failing::C;
+        use Moose;
+
+        # this reports a conflict, as it should
+        #with 'B';
+
+        our $TODO;
+        local $TODO = 'the existence of an unrelated role is interfering somehow -- need to investigate';
+        ::like(
+            ::exception { with 'Failing::Z', 'Failing::B' },
+            qr/method name conflict/,
+            'these roles should not compose without conflicts',
+        );
+    }
+}
+
 done_testing;