use callback for log interception instead of on/off
This commit is contained in:
parent
8bfa022441
commit
18525e7c1b
9 changed files with 126 additions and 268 deletions
|
|
@ -120,10 +120,12 @@ $session->user({userId => 1}); ##back to Visitor
|
|||
my $wgBdayMail = 'Thu, 16 Aug 2001 08:00:00 -0500';
|
||||
is ($dt->mailToEpoch($wgBdayMail), $wgbday, 'mailToEpoch');
|
||||
|
||||
WebGUI::Test->interceptLogging();
|
||||
WebGUI::Test->interceptLogging( sub {
|
||||
my $log_data = shift;
|
||||
|
||||
is ($dt->mailToEpoch(750), undef, 'mailToEpoch returns undef on failure to parse');
|
||||
like($WebGUI::Test::logger_warns, qr{750 is not a valid date for email}, "DateTime logs a warning on failure to parse");
|
||||
is ($dt->mailToEpoch(750), undef, 'mailToEpoch returns undef on failure to parse');
|
||||
like($log_data->{warn}, qr{750 is not a valid date for email}, "DateTime logs a warning on failure to parse");
|
||||
});
|
||||
|
||||
####################################################
|
||||
#
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue