[Jifty-commit] r6306 - jifty/trunk/lib/Jifty/Test/WWW

Jifty commits jifty-commit at lists.jifty.org
Wed Feb 4 21:34:35 EST 2009


Author: sunnavy
Date: Wed Feb  4 21:34:35 2009
New Revision: 6306

Modified:
   jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm

Log:
added no_warnings_ok method

Modified: jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm
==============================================================================
--- jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm	(original)
+++ jifty/trunk/lib/Jifty/Test/WWW/Mechanize.pm	Wed Feb  4 21:34:35 2009
@@ -452,6 +452,21 @@
     }
 }
 
+sub no_warnings_ok {
+    my $self = shift;
+    my $name = shift || "no warnings emitted";
+
+    local $Test::Builder::Level = $Test::Builder::Level;
+    $Test::Builder::Level++;
+
+    my $plugin   = Jifty->find_plugin("Jifty::Plugin::TestServerWarnings");
+    my @warnings = $plugin->decoded_warnings( $self->uri );
+
+    Test::More::is( @warnings, 0, $name );
+    for (@warnings) {
+        Test::More::diag("got warning: $_");
+    }
+}
 
 =head2 session
 


More information about the Jifty-commit mailing list