Skip tests for strict constructor on Moose
[gitmo/Mouse.git] / t / 001_mouse / 035-apply-roles-to-roles.t
CommitLineData
b1b81553 1use strict;
2use warnings;
4aaa2ed6 3use Test::More tests => 5;
b1b81553 4
5{
6 package Animal;
7 use Mouse::Role;
4aaa2ed6 8 requires 'bark';
b1b81553 9 sub eat { 'delicious' }
10 has food => ( is => 'ro' );
11}
12
13{
14 package Dog;
15 use Mouse::Role;
16 with 'Animal';
17}
18
19{
20 package Chihuahua;
21 use Mouse;
22 with 'Dog';
4aaa2ed6 23 sub bark { 'bow-wow' }
b1b81553 24}
25
26ok !Animal->can('food');
27ok !Dog->can('food');
28
29my $c = Chihuahua->new(food => 'bone');
30is $c->eat(), 'delicious';
31is $c->food(), 'bone';
4aaa2ed6 32is $c->bark(), 'bow-wow';
b1b81553 33