Explicitly use Moose::Deprecated in all modules that call ::deprecated()
[gitmo/Moose.git] / t / 020_attributes / 034_bad_coerce.t
CommitLineData
2b54d2a6 1use strict;
2use warnings;
3
4use Test::More;
f1309155 5BEGIN {
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
25done_testing;