diff options
Diffstat (limited to 't/bugs/coerce_without_coercion.t')
-rw-r--r-- | t/bugs/coerce_without_coercion.t | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/t/bugs/coerce_without_coercion.t b/t/bugs/coerce_without_coercion.t new file mode 100644 index 0000000..63b74d3 --- /dev/null +++ b/t/bugs/coerce_without_coercion.t @@ -0,0 +1,26 @@ +use strict; +use warnings; + +use Test::More; +use Test::Fatal; +use Test::Moose; + +{ + package Foo; + + use Moose; + + ::like( + ::exception { + has x => ( + is => 'rw', + isa => 'HashRef', + coerce => 1, + ) + }, + qr/You cannot coerce an attribute \(x\) unless its type \(HashRef\) has a coercion/, + "can't set coerce on an attribute whose type constraint has no coercion" + ); +} + +done_testing; |