From 3ae2f969910f6b0dbcd1b85b667f223f87ea2757 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Fri, 21 Nov 2008 01:35:04 +0000 Subject: Fixed test problems against Test::More 0.86 git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@2089 f882894a-f735-0410-b71e-b25c423dba1c diff --git a/Changes b/Changes index 36128d0..78382e1 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,9 @@ Revision history for Perl module Nagios::Plugin. +0.28 21st November 2008 + - Fixed test problems when run against Test::More 0.86 + - Added max_state_* wrappers + 0.27 14th May 2008 - Fixed parsing of performance data with scientific notation diff --git a/lib/Nagios/Plugin/Range.pm b/lib/Nagios/Plugin/Range.pm index 32a0639..536f6bb 100644 --- a/lib/Nagios/Plugin/Range.pm +++ b/lib/Nagios/Plugin/Range.pm @@ -15,6 +15,7 @@ use Nagios::Plugin::Functions qw(:DEFAULT $value_re); our ($VERSION) = $Nagios::Plugin::Functions::VERSION; use overload + 'eq' => sub { shift->_stringify }, '""' => sub { shift->_stringify }; # alert_on constants (undef == range not set) diff --git a/t/Nagios-Plugin-Performance.t b/t/Nagios-Plugin-Performance.t index 0c9ab74..fa36ce0 100644 --- a/t/Nagios-Plugin-Performance.t +++ b/t/Nagios-Plugin-Performance.t @@ -130,8 +130,10 @@ cmp_ok( $p[0]->value, "eq", "0.002722", "value okay"); cmp_ok( $p[0]->uom, "eq", "s", "uom okay"); ok( defined $p[0]->threshold->warning->is_set, "Warning range has been set"); ok( defined $p[0]->threshold->critical->is_set, "Critical range has been set"); -cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay"); -cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay"); +# 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"); @p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95"); cmp_ok( $p[0]->label, "eq", "pct_used", "label okay"); -- cgit v0.10-9-g596f