Skip to content

Commit

Permalink
Tweak undef tests for Test::Builder 1.5
Browse files Browse the repository at this point in the history
Results are no longer stored by default to save memory. Use the test summary
statistics if they are available.
  • Loading branch information
veryrusty committed Apr 12, 2013
1 parent 86635f3 commit 5749d77
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions t/undef.t
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,14 @@ TODO: {
}

my $builder = Test::More->builder;
eq_or_diff [ map { $_->{actual_ok} } $builder->details ], [ map { 0 } $builder->details ],
"All TODO tests failed";

# The Test::Builder 1.5 way to do it
if ( $builder->can('history') ) {
is $builder->history->pass_count - $builder->history->todo_count,
$builder->history->literal_pass_count,
"All TODO tests failed";
}
# The Test::Builder 0.x way to do it
else {
eq_or_diff [ map { $_->{actual_ok} } $builder->details ], [ map { 0 } $builder->details ],
"All TODO tests failed";
}

0 comments on commit 5749d77

Please sign in to comment.