From: Leon Timmermans Date: Sun, 2 Dec 2012 19:27:07 +0000 (+0100) Subject: Add failing test for mutually dependent roles X-Git-Tag: v1.003000~20 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=b0efdecc4116c74330e9ecbc5073a9f2a67c794d;p=gitmo%2FRole-Tiny.git Add failing test for mutually dependent roles --- diff --git a/t/role-basic-composition.t b/t/role-basic-composition.t index d161427..33c8ac2 100644 --- a/t/role-basic-composition.t +++ b/t/role-basic-composition.t @@ -123,4 +123,27 @@ $ENV{DEBUG} = 1; } } +{ + { + package Role1; + use Role::Tiny; + sub method1 { } + requires 'method2'; + } + + { + package Role2; + use Role::Tiny; + sub method2 { } + requires 'method1'; + } + my $success = eval <<'END'; + package Class; + use Role::Tiny::With; + with 'Role1', 'Role2'; + 1; +END + is $success, 1, 'composed mutually dependent roles successfully' or diag "Error: $@"; +} + done_testing;