diff --git a/lib/Role/Hooks.pm b/lib/Role/Hooks.pm index 2049be3..bc44b85 100644 --- a/lib/Role/Hooks.pm +++ b/lib/Role/Hooks.pm @@ -71,6 +71,7 @@ sub is_role { } no strict 'refs'; + no warnings 'once'; my $UM = ${"$target\::USES_MITE"}; if ( defined $UM and $UM eq 'Mite::Role' ) { return 'Mite::Role'; diff --git a/t/99nonrole.t b/t/99nonrole.t new file mode 100644 index 0000000..3c38153 --- /dev/null +++ b/t/99nonrole.t @@ -0,0 +1,12 @@ +use strict; +use warnings; +use Test::More; +use Role::Tiny; + +BEGIN { + package Foo; + sub new { bless [], shift } +}; + +ok ! Role::Tiny->is_role( 'Foo' ); +done_testing;