From: Shawn M Moore Date: Tue, 17 Jun 2008 02:49:22 +0000 (+0000) Subject: Make sure that required/excludes don't explode X-Git-Tag: 0.19~311 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=eb812bdec4270b062ab0f35e2d22696e92324dfe;p=gitmo%2FMouse.git Make sure that required/excludes don't explode --- diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index b1164aa..8eeadc9 100644 --- a/lib/Mouse/Role.pm +++ b/lib/Mouse/Role.pm @@ -30,6 +30,12 @@ do { with => sub { return sub { } }, + requires => sub { + return sub { } + }, + excludes => sub { + return sub { } + }, ); my $exporter = Sub::Exporter::build_exporter({ diff --git a/t/400-define-role.t b/t/400-define-role.t index bde983f..0b3da45 100644 --- a/t/400-define-role.t +++ b/t/400-define-role.t @@ -1,7 +1,7 @@ #!/usr/bin/env perl use strict; use warnings; -use Test::More tests => 5; +use Test::More tests => 7; use Test::Exception; lives_ok { @@ -64,3 +64,13 @@ lives_ok { no Mouse::Role; }; +lives_ok { + package Role; + use Mouse::Role; + + requires 'required'; + excludes 'excluded'; + + no Mouse::Role; +}; +