From: Shawn M Moore Date: Mon, 22 Aug 2011 17:56:20 +0000 (-0400) Subject: Add a test exposing [rt.cpan.org #70419] X-Git-Tag: 2.0205~12 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=e9f80694b2e97fa63afa91b929430fb258db6c61;p=gitmo%2FMoose.git Add a test exposing [rt.cpan.org #70419] --- diff --git a/t/bugs/attribute_trait_parameters.t b/t/bugs/attribute_trait_parameters.t new file mode 100644 index 0000000..1d0afc9 --- /dev/null +++ b/t/bugs/attribute_trait_parameters.t @@ -0,0 +1,47 @@ +use strict; +use warnings; +use Test::More; +use Test::Requires { + 'Test::Output' => '0.01', # skip all if not installed +}; + +{ + package R; + use Moose::Role; + + sub method { } +} + +{ + package C; + use Moose; + + ::stderr_is{ + has attr => ( + is => 'ro', + traits => [ + R => { ignored => 1 }, + ], + ); + } q{}, 'no warning with foreign parameterized attribute traits'; + + ::stderr_is{ + has alias_attr => ( + is => 'ro', + traits => [ + R => { -alias => { method => 'new_name' } }, + ], + ); + } q{}, 'no warning with -alias parameterized attribute traits'; + + ::stderr_is{ + has excludes_attr => ( + is => 'ro', + traits => [ + R => { -excludes => ['method'] }, + ], + ); + } q{}, 'no warning with -alias parameterized attribute traits'; +} + +done_testing;