From: Dave Rolsky Date: Wed, 8 Sep 2010 02:00:46 +0000 (-0500) Subject: Add a test for attribute conflict when composing one role into another X-Git-Tag: 1.13~24 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1389deda98d84200f2c637f219d66abba8f9d05a;p=gitmo%2FMoose.git Add a test for attribute conflict when composing one role into another --- diff --git a/t/030_roles/047_role_attribute_conflict.t b/t/030_roles/047_role_attribute_conflict.t new file mode 100644 index 0000000..46b3296 --- /dev/null +++ b/t/030_roles/047_role_attribute_conflict.t @@ -0,0 +1,29 @@ +use strict; +use warnings; + +use Test::More; +use Test::Exception; + +{ + package My::Role1; + use Moose::Role; + + has foo => ( + is => 'ro', + ); + +} + +{ + package My::Role2; + use Moose::Role; + + has foo => ( + is => 'ro', + ); + + ::throws_ok { with 'My::Role1' } qr/attribute conflict.+My::Role2.+foo/, + 'attribute conflict when composing one role into another'; +} + +done_testing;