$_[0]->DEMOLISHALL;
}
+sub DOES {
+ my ( $self, $class_or_role_name ) = @_;
+
+ $self->isa($class_or_role_name)
+ or
+ $self->does($class_or_role_name);
+}
+
# new does() methods will be created
# as approiate see Moose::Meta::Role
sub does {
This will check if the invocant's class C<does> a given C<$role_name>.
This is similar to C<isa> for object, but it checks the roles instead.
+=item B<DOES ($class_or_role_name)>
+
+A Moose Role aware implementation of L<UNIVERSAL/DOES>.
+
+C<DOES> is equivalent to C<isa> or C<does>.
+
=item B<dump ($maxdepth)>
Cmon, how many times have you written the following code while debugging:
use strict;
use warnings;
-use Test::More tests => 62;
+use Test::More tests => 64;
use Test::Exception;
BEGIN {
my $hundred = US::Currency->new(amount => 100.00);
isa_ok($hundred, 'US::Currency');
+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');