From: Dagfinn Ilmari Mannsåker Date: Tue, 15 Jan 2013 19:51:41 +0000 (+0000) Subject: Don't rely on callback order in tests X-Git-Tag: v0.18~15 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3e1b1e06f82e80c3d29b98acd594205abf2c7536;p=gitmo%2FMooseX-Params-Validate.git Don't rely on callback order in tests --- diff --git a/ChangeLog b/ChangeLog index 0be8e11..fb050f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ Revision history for Perl extension MooseX-Params-Validate + - Don't rely on callback order in tests + 0.16 2011-01-29 - The validated_list and validated_hash functions now accept the values to be validated as both a hash and a hash reference. diff --git a/t/001_basic.t b/t/001_basic.t index 97203db..14e8248 100644 --- a/t/001_basic.t +++ b/t/001_basic.t @@ -64,7 +64,7 @@ use Test::Fatal; foo => { isa => 'ArrayRef', callbacks => { - 'some random callback' => sub { @{ $_[0] } <= 2 }, + 'some random callback' => sub { !ref($_[0]) || @{ $_[0] } <= 2 }, }, }, );