[Nagios-Plugin] Fixed test failure with Test::More 0.96 (RT57709)

Ton Voon tonvoon at users.sourceforge.net
Fri Dec 3 12:57:19 CET 2010


 Module: Nagios-Plugin
 Branch: master
 Commit: 0b559b217bd08bb87bee018e715d01848e8d007f
 Author: nagios <nagios at opsviewdev32.(none)>
   Date: Fri Dec  3 11:56:48 2010 +0000
    URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/Nagios-Plugin;a=commit;h=0b559b2

Fixed test failure with Test::More 0.96 (RT57709)

---

 Changes                        |    3 +++
 lib/Nagios/Plugin.pm           |    2 +-
 lib/Nagios/Plugin/Functions.pm |    2 +-
 t/Nagios-Plugin-Performance.t  |    5 +++--
 4 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/Changes b/Changes
index 6061e61..29b8fc3 100644
--- a/Changes
+++ b/Changes
@@ -1,5 +1,8 @@
 Revision history for Perl module Nagios::Plugin.
 
+0.35 3rd December 2010
+  - Fixed test failures with Test::More 0.96 (Slaven Rezic and Peter John Edwards - RT57709)
+
 0.34 15th April 2010
   - Amended standard --extra-opts help
   - pod fix (Frank Wiegand - RT51872)
diff --git a/lib/Nagios/Plugin.pm b/lib/Nagios/Plugin.pm
index c363c7e..b8c6b99 100644
--- a/lib/Nagios/Plugin.pm
+++ b/lib/Nagios/Plugin.pm
@@ -26,7 +26,7 @@ our @EXPORT_OK = qw(%ERRORS %STATUS_TEXT);
 # CPAN stupidly won't index this module without a literal $VERSION here,
 #   so we're forced to duplicate it explicitly
 # Make sure you update $Nagios::Plugin::Functions::VERSION too
-our $VERSION = "0.34";
+our $VERSION = "0.35";
 
 sub new {
 	my $class = shift;
diff --git a/lib/Nagios/Plugin/Functions.pm b/lib/Nagios/Plugin/Functions.pm
index 455439c..9c32b3b 100644
--- a/lib/Nagios/Plugin/Functions.pm
+++ b/lib/Nagios/Plugin/Functions.pm
@@ -12,7 +12,7 @@ use Params::Validate qw(:types validate);
 use Math::Calc::Units;
 
 # Remember to update Nagios::Plugins as well
-our $VERSION = "0.34";
+our $VERSION = "0.35";
 
 our @STATUS_CODES = qw(OK WARNING CRITICAL UNKNOWN DEPENDENT);
 
diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t
index 6904f4c..8dce336 100644
--- a/t/Nagios-Plugin-Performance.t
+++ b/t/Nagios-Plugin-Performance.t
@@ -202,8 +202,9 @@ cmp_ok( $p[0]->uom, "eq", "s", "uom okay");
     ok( defined $p[0]->threshold->critical->is_set, "Critical range has been set");
 # The two below used to be cmp_ok, but Test::More 0.86 appears to have a problem with a stringification
 # of 0. See http://rt.cpan.org/Ticket/Display.html?id=41109
-is( $p[0]->threshold->warning, "0", "warn okay");
-is( $p[0]->threshold->critical, "0", "crit okay");
+# We need to force stringification for test. See RT 57709
+is( $p[0]->threshold->warning."", "0", "warn okay");
+is( $p[0]->threshold->critical."", "0", "crit okay");
 
 @p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95");
 cmp_ok( $p[0]->label, "eq", "pct_used", "label okay");





More information about the Commits mailing list