Created
June 11, 2009 00:23
-
-
Save jshirley/127614 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ClassA; | |
use Moose; | |
with 'Role::A'; | |
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ClassB; | |
use Moose; | |
with 'Role::A'; | |
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package Role::A; | |
use Moose::Role; | |
use ClassA; | |
sub silly_method { 1; } | |
package main; | |
use Test::More 'no_plan'; | |
use ClassA; | |
use ClassB; | |
my $a = ClassA->new; | |
my $b = ClassB->new; | |
ok($a->meta->does_role('Role::A'), 'has role'); | |
can_ok($a, 'silly_method'); | |
ok($b->meta->does_role('Role::A'), 'has role'); | |
can_ok($b, 'silly_method'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment