From: Shawn M Moore Date: Wed, 18 Jun 2008 22:39:45 +0000 (+0000) Subject: Make Role::with die X-Git-Tag: 0.19~287 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=7840048031b19bd4af654285aa855826be6fa544;p=gitmo%2FMouse.git Make Role::with die --- diff --git a/lib/Mouse/Meta/Role.pm b/lib/Mouse/Meta/Role.pm index 3c7aff1..78e01a4 100644 --- a/lib/Mouse/Meta/Role.pm +++ b/lib/Mouse/Meta/Role.pm @@ -53,7 +53,6 @@ sub apply { my @spec = $self->get_attribute($name); Mouse::Meta::Attribute->create($pkg, $name, @spec); } - } 1; diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index 57f319d..0375d0c 100644 --- a/lib/Mouse/Role.pm +++ b/lib/Mouse/Role.pm @@ -41,7 +41,9 @@ do { } }, with => sub { - return sub { } + return sub { + confess "Role does not currently support 'with'"; + } }, requires => sub { return sub { } diff --git a/t/400-define-role.t b/t/400-define-role.t index 53c77cf..4b27be5 100644 --- a/t/400-define-role.t +++ b/t/400-define-role.t @@ -55,14 +55,14 @@ do { no Mouse::Role; }; -lives_ok { +throws_ok { package Role; use Mouse::Role; with 'Other::Role'; no Mouse::Role; -}; +} qr/Role does not currently support 'with'/; lives_ok { package Role;