Commit | Line | Data |
2b54d2a6 |
1 | use strict; |
2 | use warnings; |
3 | |
4 | use Test::More; |
f1309155 |
5 | BEGIN { |
6 | eval "use Test::Output;"; |
7 | plan skip_all => "Test::Output is required for this test" if $@; |
8 | } |
2b54d2a6 |
9 | |
10 | { |
11 | package Foo; |
12 | |
13 | use Moose; |
14 | |
f1309155 |
15 | ::stderr_like{ has foo => ( |
2b54d2a6 |
16 | is => 'ro', |
17 | isa => 'Str', |
18 | coerce => 1, |
19 | ); |
f1309155 |
20 | } |
21 | qr/\QYou cannot coerce an attribute (foo) unless its type (Str) has a coercion/, |
2b54d2a6 |
22 | 'Cannot coerce unless the type has a coercion'; |
23 | } |
24 | |
25 | done_testing; |