test for excluded delegation abandoned/exclude-delegated
Ricardo Signes [Sun, 29 Nov 2009 16:21:38 +0000 (11:21 -0500)]
t/030_roles/044_exclude_delegation.t [new file with mode: 0644]

diff --git a/t/030_roles/044_exclude_delegation.t b/t/030_roles/044_exclude_delegation.t
new file mode 100644 (file)
index 0000000..34eff03
--- /dev/null
@@ -0,0 +1,26 @@
+use strict;
+use warnings;
+use Test::More;
+
+my $ok = eval {
+  {
+    package R;
+    use Moose::Role;
+
+    has foo => (is => 'ro', handles => [ 'bar' ]);
+  }
+
+  {
+    package C;
+    use Moose;
+    with 'R' => { -excludes => 'bar' };
+    sub bar { 1 }
+  }
+  1;
+};
+
+my $error = $@;
+ok($ok, "we can compose");
+unlike($error, qr{delegation}, "error is undef, right? so no delegate error");
+
+done_testing;