Make sure we're throwing errors on alias/excludes
Shawn M Moore [Mon, 8 Dec 2008 01:20:16 +0000 (01:20 +0000)]
t/101-alias-excludes.t [new file with mode: 0644]

diff --git a/t/101-alias-excludes.t b/t/101-alias-excludes.t
new file mode 100644 (file)
index 0000000..572d793
--- /dev/null
@@ -0,0 +1,36 @@
+#!/usr/bin/env perl
+use strict;
+use warnings;
+use Test::More tests => 4;
+use Test::Exception;
+
+do {
+    package MyRole;
+    use MooseX::Role::Parameterized;
+
+    ::throws_ok {
+        parameter 'alias';
+    } qr/^The parameter name \(alias\) is currently forbidden/;
+
+    ::throws_ok {
+        parameter 'excludes';
+    } qr/^The parameter name \(excludes\) is currently forbidden/;
+};
+
+do {
+    package MyClass;
+    use MooseX::Role::Parameterized;
+
+    ::throws_ok {
+        with MyRole => {
+            alias => 1,
+        };
+    } qr/^The parameter name \(alias\) is currently forbidden/;
+
+    ::throws_ok {
+        with MyRole => {
+            excludes => 1,
+        };
+    } qr/^The parameter name \(excludes\) is currently forbidden/;
+};
+