Ignore Moose::Meta::Attribute and Moose::Meta::Class for deprecation warnings
[gitmo/Moose.git] / t / 100_bugs / 030_coerce_without_coercion.t
CommitLineData
4ee48f8e 1use strict;
2use warnings;
3
4use Test::More;
5use Test::Exception;
6use Test::Moose;
7
8{
9 package Foo;
10
11 use Moose::Deprecated -api_version => '1.08';
12 use Moose;
13
14 has x => (
15 is => 'rw',
16 isa => 'HashRef',
17 coerce => 1,
18 );
19}
20
21with_immutable {
22 lives_ok { Foo->new( x => {} ) }
23 'Setting coerce => 1 without a coercion on the type does not cause an error in the constructor';
24
25 lives_ok { Foo->new->x( {} ) }
26 'Setting coerce => 1 without a coercion on the type does not cause an error when setting the attribut';
27
28 lives_ok { Foo->new( x => 42 ) } 'asasf';
29}
30'Foo';
31
32done_testing;