use 5.026; use Test::Most; { package Thing; use Moose; use Types::Standard qw( Bool Str ); has delete => ( coerce => 1, is => 'ro', isa => Str->plus_coercions( Bool, q{ $_ ? 'yes' : 'no' } ), ); } { cmp_methods( new_ok( Thing => [ delete => 1 ] ), [ delete => 'yes' ], 'attributes are coerced as expected', ); } done_testing; #### # Failed test 'attributes are coerced as expected' # at t/coercion.t line 16. # Compared $data->delete # got : '1' # expect : 'yes' # Looks like you failed 1 test of 2.