package MooseCompat;
# Moose compatible methods/functions
+
+use Test::Builder (); # should load Test::Builder first
+
use Mouse ();
use Mouse::Util::MetaRole;
use Mouse::Meta::Method;
$INC{'Mouse/Meta/Instance.pm'} = __FILE__;
$INC{'Mouse/Deprecated.pm'} = __FILE__;
-sub UNIVERSAL::DOES {
+*UNIVERSAL::DOES = sub {
my($thing, $role) = @_;
- $thing->isa($role) || Mouse::Util::does_role($thing, $role);
-}
+ $thing->isa($role);
+} unless UNIVERSAL->can('DOES');
$Mouse::Deprecated::deprecated = $Mouse::Deprecated::deprecated = undef; # -w