From: Shawn M Moore Date: Sun, 28 Sep 2008 02:51:59 +0000 (+0000) Subject: Make requires/excludes an error until they are implemented X-Git-Tag: 0.19~217 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=2badb84a6fe5f279c120179030f77c62d9b4dd05;p=gitmo%2FMouse.git Make requires/excludes an error until they are implemented --- diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index 99170c2..cf47b5b 100644 --- a/lib/Mouse/Role.pm +++ b/lib/Mouse/Role.pm @@ -51,9 +51,9 @@ sub extends { confess "Roles do not support 'extends'" } sub with { confess "Mouse::Role does not currently support 'with'" } -sub requires {} +sub requires { confess "Mouse::Role does not currently support 'requires'" } -sub excludes {} +sub excludes { confess "Mouse::Role does not currently support 'excludes'" } sub import { strict->import; diff --git a/t/400-define-role.t b/t/400-define-role.t index e5d9891..65c151e 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 => 11; +use Test::More tests => 12; use Test::Exception; lives_ok { @@ -62,17 +62,25 @@ throws_ok { with 'Other::Role'; no Mouse::Role; -} qr/Role does not currently support 'with'/; +} qr/Mouse::Role does not currently support 'with'/; -lives_ok { +throws_ok { package Role; use Mouse::Role; requires 'required'; + + no Mouse::Role; +} qr/Mouse::Role does not currently support 'requires'/; + +throws_ok { + package Role; + use Mouse::Role; + excludes 'excluded'; no Mouse::Role; -}; +} qr/Mouse::Role does not currently support 'excludes'/; throws_ok { package Role;