diff options
Diffstat (limited to 't/bugs/native_trait_handles_bad_value.t')
-rw-r--r-- | t/bugs/native_trait_handles_bad_value.t | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/t/bugs/native_trait_handles_bad_value.t b/t/bugs/native_trait_handles_bad_value.t new file mode 100644 index 0000000..34824aa --- /dev/null +++ b/t/bugs/native_trait_handles_bad_value.t @@ -0,0 +1,27 @@ +use strict; +use warnings; + +use Test::More; +use Test::Fatal; + +{ + + package Bug; + use Moose; + + ::like( + ::exception{ has member => ( + is => 'ro', + isa => 'HashRef', + traits => ['Hash'], + handles => { + method => sub { } + }, + ); + }, + qr/\QAll values passed to handles must be strings or ARRAY references, not CODE/, + 'bad value in handles throws a useful error' + ); +} + +done_testing; |