From: Dave Rolsky Date: Thu, 1 Sep 2011 14:52:30 +0000 (-0500) Subject: Add test for error message from bad handles value with native traits (RT #69990) X-Git-Tag: 2.0205~4 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=c3a77ff6a310b679548a7797c15b66339afa2dc6;p=gitmo%2FMoose.git Add test for error message from bad handles value with native traits (RT #69990) --- 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;