diff options
author | Ton Voon <tonvoon@users.sourceforge.net> | 2006-06-15 09:11:54 +0000 |
---|---|---|
committer | Ton Voon <tonvoon@users.sourceforge.net> | 2006-06-15 09:11:54 +0000 |
commit | f948ceecba9b5f6cb0aef9aae6f6be18ba6feffe (patch) | |
tree | 687e8c72f89ae9cced849754e362f1cde19ae745 /t/Nagios-Plugin-Threshold.t | |
parent | e736a3c2b0a62707f12cf66fbb65ef23eeb01dd6 (diff) | |
download | monitoring-plugin-perl-f948ceecba9b5f6cb0aef9aae6f6be18ba6feffe.tar.gz |
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
Diffstat (limited to 't/Nagios-Plugin-Threshold.t')
-rw-r--r-- | t/Nagios-Plugin-Threshold.t | 8 |
1 files changed, 4 insertions, 4 deletions
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); | |||
8 | 8 | ||
9 | my $t = Nagios::Plugin::Threshold->set_thresholds(critical => "80"); | 9 | my $t = Nagios::Plugin::Threshold->set_thresholds(critical => "80"); |
10 | ok( defined $t, "Threshold ('', '80') set"); | 10 | ok( defined $t, "Threshold ('', '80') set"); |
11 | ok( ! defined $t->warning, "Warning not set"); | 11 | ok( ! $t->warning->is_set, "Warning not set"); |
12 | cmp_ok( $t->critical->end, '==', 80, "Critical set correctly"); | 12 | cmp_ok( $t->critical->end, '==', 80, "Critical set correctly"); |
13 | 13 | ||
14 | $t = Nagios::Plugin::Threshold->set_thresholds(warning => "5:33", critical => ""); | 14 | $t = Nagios::Plugin::Threshold->set_thresholds(warning => "5:33", critical => ""); |
15 | ok( defined $t, "Threshold ('5:33', '') set"); | 15 | ok( defined $t, "Threshold ('5:33', '') set"); |
16 | cmp_ok( $t->warning->start, '==', 5, "Warning start set"); | 16 | cmp_ok( $t->warning->start, '==', 5, "Warning start set"); |
17 | cmp_ok( $t->warning->end, '==', 33, "Warning end set"); | 17 | cmp_ok( $t->warning->end, '==', 33, "Warning end set"); |
18 | ok( ! defined $t->critical, "Critical not set"); | 18 | ok( ! $t->critical->is_set, "Critical not set"); |
19 | 19 | ||
20 | $t = Nagios::Plugin::Threshold->set_thresholds(warning => "30", critical => "60"); | 20 | $t = Nagios::Plugin::Threshold->set_thresholds(warning => "30", critical => "60"); |
21 | ok( defined $t, "Threshold ('30', '60') set"); | 21 | ok( defined $t, "Threshold ('30', '60') set"); |
@@ -27,6 +27,6 @@ cmp_ok( $t->get_status(69), '==', $ERRORS{CRITICAL}, "69 - critical"); | |||
27 | 27 | ||
28 | $t = Nagios::Plugin::Threshold->set_thresholds(warning => "total", critical => "rubbish"); | 28 | $t = Nagios::Plugin::Threshold->set_thresholds(warning => "total", critical => "rubbish"); |
29 | ok( defined $t, "Threshold object created although ..."); | 29 | ok( defined $t, "Threshold object created although ..."); |
30 | ok( ! defined $t->warning, "Warning not set"); | 30 | ok( ! $t->warning->is_set, "Warning not set"); |
31 | ok( ! defined $t->critical, "Critical not set"); | 31 | ok( ! $t->critical->is_set, "Critical not set"); |
32 | 32 | ||