From: Shawn M Moore Date: Tue, 17 Jun 2008 02:31:39 +0000 (+0000) Subject: Blow up when someone tries to use a role extends X-Git-Tag: 0.19~316 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=8da998d9d52f4f1bed58f3b196cccbd725959c56;p=gitmo%2FMouse.git Blow up when someone tries to use a role extends --- diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index 7530423..f5da880 100644 --- a/lib/Mouse/Role.pm +++ b/lib/Mouse/Role.pm @@ -4,11 +4,17 @@ use strict; use warnings; use Sub::Exporter; +use Carp 'confess'; do { my $CALLER; my %exports = ( + extends => sub { + return sub { + confess "Mouse::Role does not currently support 'extends'"; + } + }, ); my $exporter = Sub::Exporter::build_exporter({ diff --git a/t/400-define-role.t b/t/400-define-role.t index b7893ea..4c27de0 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 => 1; +use Test::More tests => 2; use Test::Exception; lives_ok { @@ -11,3 +11,10 @@ lives_ok { no Mouse::Role; }; +throws_ok { + package Role; + use Mouse::Role; + + extends 'Role::Parent'; +} qr/Mouse::Role does not currently support 'extends'/; +