Skip to content
Browse files

Test framework: handle unexpected additional messages

  • Loading branch information...
1 parent ca171b2 commit 3c6723318cbd0324c2c4bc4fb7033166e33acf98 @dolmen committed Oct 24, 2010
Showing with 4 additions and 0 deletions.
  1. +4 −0 t/lib/Log/Dispatch/Config/Test.pm
View
4 t/lib/Log/Dispatch/Config/Test.pm
@@ -9,6 +9,10 @@ use Test::More;
sub expect
{
my ($self, $got, $expected) = @_;
+ unless (defined $expected) {
+ Test::More::fail "message '$got->{message}' unexpected";
+ return;
+ }
local $TODO = $expected->{TODO} if exists $expected->{TODO};
Test::More::is($got->{level}, $expected->{level}, "level $expected->{level} ok");
Test::More::is($got->{message}, $expected->{message}, "message '$expected->{message}' ok");

0 comments on commit 3c67233

Please sign in to comment.
Something went wrong with that request. Please try again.