no automatic travis testing for wip/blocked branches
[gitmo/Moo.git] / xt / moo-consume-mouse-role-coerce.t
CommitLineData
f96bb37c 1use strict;
2use warnings;
3use Test::More;
4
5{
6 package RoleOne;
7 use Mouse::Role;
8 use Mouse::Util::TypeConstraints;
9 use namespace::autoclean;
10
11 subtype 'Foo', as 'Int';
12 coerce 'Foo', from 'Str', via { 3 };
13
14 has foo => (
15 is => 'rw',
16 isa => 'Foo',
17 coerce => 1,
18 clearer => '_clear_foo',
19 );
20}
21{
22 package Class;
23 use Moo; # Works if use Moose..
24 use namespace::clean -except => 'meta';
25
26 with 'RoleOne';
27}
28
29my $i = Class->new( foo => 'bar' );
30is $i->foo, 3;
31
32done_testing;
33