diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2008-11-21 01:35:04 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2008-11-21 01:35:04 +0000 |
commit | 3ae2f969910f6b0dbcd1b85b667f223f87ea2757 (patch) | |
tree | 12e3e724fcc9b30bd641e158183a8a88d16d60eb | |
parent | 96e9e6710ff0e4a0b0354c44e9e0aec4ee8fc7cd (diff) | |
download | monitoring-plugin-perl-3ae2f969910f6b0dbcd1b85b667f223f87ea2757.tar.gz |
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
-rw-r--r-- | Changes | 4 | ||||
-rw-r--r-- | lib/Nagios/Plugin/Range.pm | 1 | ||||
-rw-r--r-- | t/Nagios-Plugin-Performance.t | 6 |
3 files changed, 9 insertions, 2 deletions
@@ -1,5 +1,9 @@ | |||
1 | Revision history for Perl module Nagios::Plugin. | 1 | Revision history for Perl module Nagios::Plugin. |
2 | 2 | ||
3 | 0.28 21st November 2008 | ||
4 | - Fixed test problems when run against Test::More 0.86 | ||
5 | - Added max_state_* wrappers | ||
6 | |||
3 | 0.27 14th May 2008 | 7 | 0.27 14th May 2008 |
4 | - Fixed parsing of performance data with scientific notation | 8 | - Fixed parsing of performance data with scientific notation |
5 | 9 | ||
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); | |||
15 | our ($VERSION) = $Nagios::Plugin::Functions::VERSION; | 15 | our ($VERSION) = $Nagios::Plugin::Functions::VERSION; |
16 | 16 | ||
17 | use overload | 17 | use overload |
18 | 'eq' => sub { shift->_stringify }, | ||
18 | '""' => sub { shift->_stringify }; | 19 | '""' => sub { shift->_stringify }; |
19 | 20 | ||
20 | # alert_on constants (undef == range not set) | 21 | # 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"); | |||
130 | cmp_ok( $p[0]->uom, "eq", "s", "uom okay"); | 130 | cmp_ok( $p[0]->uom, "eq", "s", "uom okay"); |
131 | ok( defined $p[0]->threshold->warning->is_set, "Warning range has been set"); | 131 | ok( defined $p[0]->threshold->warning->is_set, "Warning range has been set"); |
132 | ok( defined $p[0]->threshold->critical->is_set, "Critical range has been set"); | 132 | ok( defined $p[0]->threshold->critical->is_set, "Critical range has been set"); |
133 | cmp_ok( $p[0]->threshold->warning, 'eq', "0", "warn okay"); | 133 | # The two below used to be cmp_ok, but Test::More 0.86 appears to have a problem with a stringification |
134 | cmp_ok( $p[0]->threshold->critical, 'eq', "0", "crit okay"); | 134 | # of 0. See http://rt.cpan.org/Ticket/Display.html?id=41109 |
135 | is( $p[0]->threshold->warning, "0", "warn okay"); | ||
136 | is( $p[0]->threshold->critical, "0", "crit okay"); | ||
135 | 137 | ||
136 | @p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95"); | 138 | @p = Nagios::Plugin::Performance->parse_perfstring("pct_used=73.7%;90;95"); |
137 | cmp_ok( $p[0]->label, "eq", "pct_used", "label okay"); | 139 | cmp_ok( $p[0]->label, "eq", "pct_used", "label okay"); |