support isa and coerce together for Moose
[gitmo/Moo.git] / xt / moo-does-moose-role.t
CommitLineData
a84066c7 1use strictures 1;
2use Test::More;
3
4BEGIN {
5 package Splat;
6
7 use Moose::Role;
8
9 requires 'monkey';
10
11 sub punch { 1 }
12
13 sub jab { 0 }
14
15 around monkey => sub { 'OW' };
16
17 has trap => (is => 'ro', default => sub { -1 });
18}
19
20BEGIN {
21 package Splattered;
22
23 use Moo;
24
25 sub monkey { 'WHAT' }
26
27 with 'Splat';
28
29 sub jab { 3 }
30}
31
32my $s = Splattered->new;
33
34is($s->punch, 1, 'punch');
35is($s->jab, 3, 'jab');
36is($s->monkey, 'OW', 'monkey');
37is($s->trap, -1, 'trap');
38
39done_testing;