From: Shawn M Moore Date: Tue, 17 Jun 2008 02:49:03 +0000 (+0000) Subject: Make sure that "has" doesn't blow up X-Git-Tag: 0.19~313 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=26482d3ff20c9e131b14e5fbf949b0eeadcea7c6;p=gitmo%2FMouse.git Make sure that "has" doesn't blow up --- diff --git a/lib/Mouse/Role.pm b/lib/Mouse/Role.pm index 89a44c7..3392f3e 100644 --- a/lib/Mouse/Role.pm +++ b/lib/Mouse/Role.pm @@ -24,6 +24,9 @@ do { around => sub { return sub { } }, + has => sub { + return sub { } + }, ); my $exporter = Sub::Exporter::build_exporter({ diff --git a/t/400-define-role.t b/t/400-define-role.t index 0920e35..ffc51d8 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 => 4; +use Test::More tests => 5; use Test::Exception; lives_ok { @@ -25,6 +25,8 @@ lives_ok { use Mouse::Role; sub foo {} + + no Mouse::Role; }; lives_ok { @@ -34,5 +36,16 @@ lives_ok { before foo => sub {}; after foo => sub {}; around foo => sub {}; + + no Mouse::Role; +}; + +lives_ok { + package Role; + use Mouse::Role; + + has 'foo'; + + no Mouse::Role; };