summaryrefslogtreecommitdiff
path: root/t/bugs/attribute_trait_parameters.t
diff options
context:
space:
mode:
authorLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
committerLorry Tar Creator <lorry-tar-importer@lorry>2015-06-06 17:50:16 +0000
commit5ac2026f7eed78958d69d051e7a8e993dcf51205 (patch)
tree298c3d2f08bdfe5689998b11892d72a897985be1 /t/bugs/attribute_trait_parameters.t
downloadMoose-tarball-5ac2026f7eed78958d69d051e7a8e993dcf51205.tar.gz
Diffstat (limited to 't/bugs/attribute_trait_parameters.t')
-rw-r--r--t/bugs/attribute_trait_parameters.t46
1 files changed, 46 insertions, 0 deletions
diff --git a/t/bugs/attribute_trait_parameters.t b/t/bugs/attribute_trait_parameters.t
new file mode 100644
index 0000000..cd053d1
--- /dev/null
+++ b/t/bugs/attribute_trait_parameters.t
@@ -0,0 +1,46 @@
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Requires 'Test::Output'; # 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 -excludes parameterized attribute traits';
+}
+
+done_testing;