From: Ricardo Signes Date: Sun, 29 Nov 2009 16:21:38 +0000 (-0500) Subject: test for excluded delegation X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=refs%2Fheads%2Fabandoned%2Fexclude-delegated;p=gitmo%2FMoose.git test for excluded delegation --- diff --git a/t/030_roles/044_exclude_delegation.t b/t/030_roles/044_exclude_delegation.t new file mode 100644 index 0000000..34eff03 --- /dev/null +++ b/t/030_roles/044_exclude_delegation.t @@ -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;