From: Dave Rolsky Date: Mon, 14 Mar 2011 03:49:12 +0000 (-0500) Subject: Make sure that applied_attribute roles don't spill over to other roles to during... X-Git-Tag: 1.9905~17 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=51c788414482c813eb48fb417b08ba03134ff1a6;p=gitmo%2FMoose.git Make sure that applied_attribute roles don't spill over to other roles to during role composition --- diff --git a/t/030_roles/046_role_attr_application.t b/t/030_roles/046_role_attr_application.t index bd0e728..2f6463b 100644 --- a/t/030_roles/046_role_attr_application.t +++ b/t/030_roles/046_role_attr_application.t @@ -3,6 +3,7 @@ use strict; use warnings; use Test::More; use Test::Moose; +use Moose::Util qw( does_role ); { package Foo::Meta::Attribute; @@ -212,6 +213,7 @@ ok(!Moose::Util::does_role(Baz->meta->get_attribute('foo'), 'Baz::Meta::Attribut use Moose::Role; has foo => (traits => ['Quux::Meta::Role::Attribute'], is => 'ro'); + has baz => (is => 'ro'); } { @@ -237,6 +239,10 @@ ok(!Moose::Util::does_role(Baz->meta->get_attribute('foo'), 'Baz::Meta::Attribut my $foo = Quux->meta->get_attribute('foo'); does_ok($foo, 'Quux::Meta::Role::Attribute', "individual attribute trait applied correctly"); + + my $baz = Quux->meta->get_attribute('baz'); + ok(! does_role($baz, 'Quux::Meta::Role::Attribute'), + "applied_attribute traits do not end up applying to attributes from other roles during composition"); } {