Skip to content

Instantly share code, notes, and snippets.

@jshirley
Created June 11, 2009 00:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jshirley/127614 to your computer and use it in GitHub Desktop.
Save jshirley/127614 to your computer and use it in GitHub Desktop.
package ClassA;
use Moose;
with 'Role::A';
1;
package ClassB;
use Moose;
with 'Role::A';
1;
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