From: Graham Knop Date: Tue, 14 May 2013 22:10:32 +0000 (-0400) Subject: test for trait inflation from moo roles X-Git-Tag: v1.003000~71 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=ac0a2c9a69abe7b83dd18e86b0bff0b7d6e17053;p=gitmo%2FMoo.git test for trait inflation from moo roles --- diff --git a/xt/moo-roles-into-moose-class.t b/xt/moo-roles-into-moose-class.t index ac17d30..c22f406 100644 --- a/xt/moo-roles-into-moose-class.t +++ b/xt/moo-roles-into-moose-class.t @@ -1,6 +1,7 @@ use strict; use warnings; use Test::More; +use Test::Fatal; { package Foo; @@ -43,6 +44,27 @@ use Test::More; /; } -ok 1; +{ + package Baw; + use Moo::Role; + has attr => ( + is => 'ro', + traits => ['Array'], + default => sub { [] }, + handles => { + push_attr => 'push', + }, + ); +} +{ + package Buh; + use Moose; + with 'Baw'; +} + +is exception { + Buh->new->push_attr(1); +}, undef, 'traits in role attributes are inflated properly'; + done_testing;