Permalink
Browse files

fix test failure when Devel::PartialDump is not installed

  • Loading branch information...
1 parent 2fb24b0 commit a68a6b379be1945304c1bdd27bc0e7082a7b752b @karenetheridge committed Mar 6, 2013
Showing with 13 additions and 6 deletions.
  1. +1 −0 Changes
  2. +12 −6 t/03-moosex-types.t
View
@@ -4,6 +4,7 @@ Revision history for {{$dist->name}}
- fixed bad link in 'SEE ALSO'
- fixed test failure due to bad plan when MooseX::Types is not
available
+ - fixed test failure when Devel::PartialDump is not installed
0.002 2013-03-04 10:43:05 PST-0800 (Karen Etheridge)
- fix extraction of type name from MooseX::Types types
View
@@ -15,7 +15,7 @@ use Test::Deep;
use Test::Deep::Type;
-check_tests(
+my @results = check_tests(
sub {
cmp_deeply(
{ message => 'ack I am slain' },
@@ -41,13 +41,19 @@ check_tests(
ok => 0,
name => 'message is a string',
type => '',
- diag => <<EOM,
-Validating \$data->{"message"} as a Str type
- got : Validation failed for 'Str' with value { foo: 1 }
-expect : no error
-EOM
+ # see diag check below
},
],
'success and failure with a MooseX::Types type',
);
+# we don't know if Devel::PartialDump is installed, which changes how the
+# value is dumped
+like(
+ $results[-1]->{diag},
+ qr/\A^Validating \$data->\{"message"\} as a Str type$
+^ got : Validation failed for 'Str' with value [^\n]+$
+^expect : no error$/ms,
+ 'diag failure message',
+);
+

0 comments on commit a68a6b3

Please sign in to comment.