[Rt-commit] r15916 - in rt/3.8/trunk: lib/RT/Test
sartak at bestpractical.com
sartak at bestpractical.com
Thu Sep 11 04:54:45 EDT 2008
Author: sartak
Date: Thu Sep 11 04:54:44 2008
New Revision: 15916
Modified:
rt/3.8/trunk/ (props changed)
rt/3.8/trunk/lib/RT/Test/Web.pm
Log:
r71648 at onn: sartak | 2008-09-11 04:54:16 -0400
Method to quickly confirm that there are no pending warnings
Modified: rt/3.8/trunk/lib/RT/Test/Web.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Test/Web.pm (original)
+++ rt/3.8/trunk/lib/RT/Test/Web.pm Thu Sep 11 04:54:44 2008
@@ -173,4 +173,20 @@
return Test::More::like($warnings[0], $re, $name);
}
+sub no_warnings_ok {
+ my $self = shift;
+ my $name = shift || "no warnings emitted";
+
+ local $Test::Builder::Level = $Test::Builder::Level + 1;
+
+ my @warnings = $self->get_warnings;
+
+ Test::More::is(@warnings, 0, $name);
+ for (@warnings) {
+ Test::More::diag("got warning: $_");
+ }
+
+ return @warnings == 0 ? 1 : 0;
+}
+
1;
More information about the Rt-commit
mailing list