diff options
author | Gavin Carr <gonzai@users.sourceforge.net> | 2006-09-26 04:10:37 +0000 |
---|---|---|
committer | Gavin Carr <gonzai@users.sourceforge.net> | 2006-09-26 04:10:37 +0000 |
commit | 3a58d586f935a35390196bbbb65b36d5c651fe93 (patch) | |
tree | 4ed74dec16c5e8d4a223f5aa80bb4e7a55f016d2 /t | |
parent | e548a22a92b3aa345f4a952fddb39cc693c35a70 (diff) | |
download | monitoring-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.t | 18 |
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 | ||
3 | use strict; | 3 | use strict; |
4 | use Test::More tests => 33; | 4 | use Test::More tests => 37; |
5 | 5 | ||
6 | BEGIN { use_ok("Nagios::Plugin::Functions", ":all") } | 6 | BEGIN { 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 | |||
160 | is($code, WARNING, "(warning) code is $STATUS_TEXT{$code}"); | 160 | is($code, WARNING, "(warning) code is $STATUS_TEXT{$code}"); |
161 | is($message, 'D E F', "join_all '$join_all' (critical, warning) message is $message"); | 161 | is($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 | ||
167 | ok(! defined eval { ($code, $message) = check_messages() }, | ||
168 | "check_messages dies without message args"); | ||
169 | |||
170 | ok(! defined eval { ($code, $message) = check_messages(warning => $arrays{warning}) }, | ||
171 | "check_messages dies without 'critical' message"); | ||
172 | |||
173 | ok(! defined eval { ($code, $message) = check_messages(critical => $arrays{critical}) }, | ||
174 | "check_messages dies without 'warning' message"); | ||
175 | |||
176 | ok(defined eval { ($code, $message) = check_messages(critical => $arrays{critical}, warning => $arrays{warning}) }, | ||
177 | "check_messages ok with 'critical' and 'warning' messages"); | ||
178 | |||