Subject: | Role::Tiny doesn't override UNIVERSAL::DOES |
While Role::Tiny roles provide a "does" method for classes that consume
them, they don't touch "DOES", which (as of Perl 5.10) is the standard
Perl way of indicating that objects and classes do a role.
Moose and Mouse both override DOES. So should Moo.
Subject: | moo-role.pl |
use Test::More tests => 2;
{
package Transport;
use Role::Tiny;
}
{
package Train;
use Role::Tiny::With;
with qw(Transport);
sub new {
my ($class, %args) = @_;
bless \%args => $class;
}
}
my $thomas = Train->new;
ok $thomas->does('Transport');
ok $thomas->DOES('Transport');