From f948ceecba9b5f6cb0aef9aae6f6be18ba6feffe Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Thu, 15 Jun 2006 09:11:54 +0000 Subject: is_set method to see if a range has been set git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1429 f882894a-f735-0410-b71e-b25c423dba1c --- t/Nagios-Plugin-Threshold.t | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 't/Nagios-Plugin-Threshold.t') diff --git a/t/Nagios-Plugin-Threshold.t b/t/Nagios-Plugin-Threshold.t index 764f7b0..97d4fcc 100644 --- a/t/Nagios-Plugin-Threshold.t +++ b/t/Nagios-Plugin-Threshold.t @@ -8,14 +8,14 @@ Nagios::Plugin::Base->print_on_die(0); my $t = Nagios::Plugin::Threshold->set_thresholds(critical => "80"); ok( defined $t, "Threshold ('', '80') set"); -ok( ! defined $t->warning, "Warning not set"); +ok( ! $t->warning->is_set, "Warning not set"); cmp_ok( $t->critical->end, '==', 80, "Critical set correctly"); $t = Nagios::Plugin::Threshold->set_thresholds(warning => "5:33", critical => ""); ok( defined $t, "Threshold ('5:33', '') set"); cmp_ok( $t->warning->start, '==', 5, "Warning start set"); cmp_ok( $t->warning->end, '==', 33, "Warning end set"); -ok( ! defined $t->critical, "Critical not set"); +ok( ! $t->critical->is_set, "Critical not set"); $t = Nagios::Plugin::Threshold->set_thresholds(warning => "30", critical => "60"); ok( defined $t, "Threshold ('30', '60') set"); @@ -27,6 +27,6 @@ cmp_ok( $t->get_status(69), '==', $ERRORS{CRITICAL}, "69 - critical"); $t = Nagios::Plugin::Threshold->set_thresholds(warning => "total", critical => "rubbish"); ok( defined $t, "Threshold object created although ..."); -ok( ! defined $t->warning, "Warning not set"); -ok( ! defined $t->critical, "Critical not set"); +ok( ! $t->warning->is_set, "Warning not set"); +ok( ! $t->critical->is_set, "Critical not set"); -- cgit v1.2.3-74-g34f1