no automatic travis testing for wip/blocked branches
[gitmo/Moo.git] / xt / moose-override-attribute-from-moo-role.t
CommitLineData
46764550 1use strict;
2use warnings;
3use Test::More;
4use Test::Fatal;
5
6{
7 package MyRole;
8 use Moo::Role;
9
10 has foo => (
11 is => 'ro',
12 required => 1,
13 );
14}
15{
16 package MyClass;
17 use Moose;
18
19 with 'MyRole';
20
21 has '+foo' => (
22 isa => 'Str',
23 );
24}
25
26is(
27 exception { MyClass->new(foo => 'bar') },
28 undef,
29 'construct'
30);
31ok(
32 exception { MyClass->new(foo => []) },
33 'no construct, constraint works'
34);
35ok(
36 exception { MyClass->new() },
37 'no construct - require still works'
38);
39
40done_testing;
41