Commit | Line | Data |
a84066c7 |
1 | use strictures 1; |
2 | use Test::More; |
3 | |
4 | BEGIN { |
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 | |
20 | BEGIN { |
21 | package Splattered; |
22 | |
23 | use Moo; |
24 | |
25 | sub monkey { 'WHAT' } |
26 | |
27 | with 'Splat'; |
28 | |
29 | sub jab { 3 } |
30 | } |
31 | |
32 | my $s = Splattered->new; |
33 | |
34 | is($s->punch, 1, 'punch'); |
35 | is($s->jab, 3, 'jab'); |
36 | is($s->monkey, 'OW', 'monkey'); |
37 | is($s->trap, -1, 'trap'); |
38 | |
39 | done_testing; |