[Rt-commit] rt branch, topic/test-log4perl, created. d503c842d70f10a44ef4498645123ec2464e543a
clkao at bestpractical.com
clkao at bestpractical.com
Tue Nov 10 09:12:09 EST 2009
The branch, topic/test-log4perl has been created
at d503c842d70f10a44ef4498645123ec2464e543a (commit)
- Log -----------------------------------------------------------------
commit d503c842d70f10a44ef4498645123ec2464e543a
Author: Chia-liang Kao <clkao at bestpractical.com>
Date: Tue Nov 10 22:09:53 2009 +0800
Expect error with test::log4per.
diff --git a/t/lorzy/error.t b/t/lorzy/error.t
index 2f36e42..cc2b507 100644
--- a/t/lorzy/error.t
+++ b/t/lorzy/error.t
@@ -1,6 +1,7 @@
-use Test::More tests => 6;
+use Test::More tests => 7;
+use Test::NoWarnings;
use RT::Test strict => 1;
-
+use Test::Log4perl;
use strict;
use warnings;
@@ -52,7 +53,12 @@ $rule->create( description => 'test worky action',
RT::Lorzy::Dispatcher->flush_cache;
-my ($txn_id, $tmsg, $txn) = $ticket->comment(content => 'lorzy lorzy in the code');
+my ($txn_id, $tmsg, $txn);
+
+{
+ my $log = Test::Log4perl->expect(['Jifty', ignore_priority => 'INFO', 'error' => qr(Rule 'test fail action' condition error, ignoring: LCore: fail)]);
+ ($txn_id, $tmsg, $txn) = $ticket->comment(content => 'lorzy lorzy in the code');
+}
my ($this_rule) = grep { $_->description eq 'test fail action'} @{$txn->rules};
ok(!$this_rule, 'not running failing condition rules');
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list