From: Dave Rolsky Date: Mon, 14 Feb 2011 03:29:13 +0000 (-0600) Subject: Failing test from ether X-Git-Tag: v0.23~11 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=24820a421a0021182925bc26f9c17d84bf01b989;p=gitmo%2FMooseX-ClassAttribute.git Failing test from ether --- diff --git a/t/11-strict-role-composition.t b/t/11-strict-role-composition.t new file mode 100644 index 0000000..3e5cd8c --- /dev/null +++ b/t/11-strict-role-composition.t @@ -0,0 +1,51 @@ +# Reported as https://rt.cpan.org/Public/Bug/Display.html?id=59663 + +use strict; +use warnings; + +use Test::More tests => 3; +use Test::Fatal; + +use Test::Requires { + 'MooseX::Role::Strict' => 0.01, +}; + +{ + package Role; + + use MooseX::Role::Strict; + use MooseX::ClassAttribute; + + class_has attr => ( + is => 'ro', + isa => 'HashRef[Str]', + lazy => 1, + default => sub { {} }, + traits => ['Hash'], + handles => { + has_attr => 'exists', + }, + ); + + sub normal_method { + Test::More::pass('a regular method from the role is composed'); + } + +} + +{ + package Foo; + use Moose; + + with 'Role'; +} + +use Test::NoWarnings; + +Foo->normal_method(); + +is( + exception { Foo->has_attr('key') }, undef, + 'Delegated method from native attribute trait is properly composed from a strict role' +); +