summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorGavin Carr <gonzai@users.sourceforge.net>2006-09-26 04:10:37 (GMT)
committerGavin Carr <gonzai@users.sourceforge.net>2006-09-26 04:10:37 (GMT)
commit3a58d586f935a35390196bbbb65b36d5c651fe93 (patch)
tree4ed74dec16c5e8d4a223f5aa80bb4e7a55f016d2 /t
parente548a22a92b3aa345f4a952fddb39cc693c35a70 (diff)
downloadmonitoring-plugin-perl-3a58d586f935a35390196bbbb65b36d5c651fe93.tar.gz
Update Nagios::Plugin with NP::Function wrapper methods, and extras.
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1483 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 't')
-rw-r--r--t/Nagios-Plugin-Functions-02.t18
1 files changed, 17 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-Functions-02.t b/t/Nagios-Plugin-Functions-02.t
index 981e2eb..1a9351b 100644
--- a/t/Nagios-Plugin-Functions-02.t
+++ b/t/Nagios-Plugin-Functions-02.t
@@ -1,7 +1,7 @@
1# check_messages tests 1# check_messages tests
2 2
3use strict; 3use strict;
4use Test::More tests => 33; 4use Test::More tests => 37;
5 5
6BEGIN { use_ok("Nagios::Plugin::Functions", ":all") } 6BEGIN { use_ok("Nagios::Plugin::Functions", ":all") }
7 7
@@ -160,3 +160,19 @@ is($message, $msg_all_wo, "join_all '$join_all' (critical, warning, \$ok) messag
160is($code, WARNING, "(warning) code is $STATUS_TEXT{$code}"); 160is($code, WARNING, "(warning) code is $STATUS_TEXT{$code}");
161is($message, 'D E F', "join_all '$join_all' (critical, warning) message is $message"); 161is($message, 'D E F', "join_all '$join_all' (critical, warning) message is $message");
162 162
163# -------------------------------------------------------------------------
164# Error cases
165
166# Test failures without required fields
167ok(! defined eval { ($code, $message) = check_messages() },
168 "check_messages dies without message args");
169
170ok(! defined eval { ($code, $message) = check_messages(warning => $arrays{warning}) },
171 "check_messages dies without 'critical' message");
172
173ok(! defined eval { ($code, $message) = check_messages(critical => $arrays{critical}) },
174 "check_messages dies without 'warning' message");
175
176ok(defined eval { ($code, $message) = check_messages(critical => $arrays{critical}, warning => $arrays{warning}) },
177 "check_messages ok with 'critical' and 'warning' messages");
178