package Mouse::Object;
use Mouse::Util qw(does dump meta); # enables strict and warnings
# all the stuff are defined in XS or PP
+
+sub DOES {
+ my($self, $class_or_role_name) = @_;
+ return $self->isa($class_or_role_name) || $self->does($class_or_role_name);
+}
+
1;
__END__
my $hundred = US::Currency->new( amount => 100.00 );
isa_ok( $hundred, 'US::Currency' );
-{
-local $TODO = 'UNIVERSAL::DOES is not supported';
-ok( eval{ $hundred->DOES("US::Currency") }, "UNIVERSAL::DOES for class" );
-ok( eval{ $hundred->DOES("Comparable") }, "UNIVERSAL::DOES for role" );
-}
+ok( $hundred->DOES("US::Currency"), "UNIVERSAL::DOES for class" );
+ok( $hundred->DOES("Comparable"), "UNIVERSAL::DOES for role" );
can_ok( $hundred, 'amount' );
is( $hundred->amount, 100, '... got the right amount' );