From: Shawn M Moore Date: Mon, 8 Dec 2008 01:20:16 +0000 (+0000) Subject: Make sure we're throwing errors on alias/excludes X-Git-Tag: 0.05~32 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=f7d126782a79307560efd647acb7bb98be65717f;hp=4f3cfe3fd5a511e6503fcc1da85fb937a7d67863;p=gitmo%2FMooseX-Role-Parameterized.git Make sure we're throwing errors on alias/excludes --- diff --git a/t/101-alias-excludes.t b/t/101-alias-excludes.t new file mode 100644 index 0000000..572d793 --- /dev/null +++ b/t/101-alias-excludes.t @@ -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/; +}; +