Skip to content

Commit

Permalink
Suppress printing of exceptions in test suite
Browse files Browse the repository at this point in the history
We *know* they're coming, so why complain about them to the user?
  • Loading branch information
hoelzro committed Jan 26, 2015
1 parent 7fff19b commit acd0699
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions t/lib/Plack/Test/AnyEvent/Test.pm
Expand Up @@ -21,6 +21,31 @@ sub startup :Test(startup) {
); # just get the ball rolling

diag "Running on $AnyEvent::MODEL";

do {
no warnings 'once'; ## no critic (TestingAndDebugging::ProhibitNoWarnings)
$EV::DIED = sub {
unless($@ =~ /bad apple/) {
warn $@;
}
};
$Event::DIED = sub {
my ( undef, $error ) = @_;

unless($error =~ /bad apple/ || $error eq '?') {
warn $error;
}
};

eval { Glib->install_exception_handler(sub {
my ( $error ) = @_;

unless($error =~ /bad apple/) {
warn $error;
}
return 1;
})};
};
}

sub test_simple_app :Test(3) {
Expand Down

0 comments on commit acd0699

Please sign in to comment.