[Nagiosplug-checkins] Nagios-Plugin/t Nagios-Plugin-Functions-02.t, 1.1, 1.2
Gavin Carr
gonzai at users.sourceforge.net
Tue Sep 26 06:10:39 CEST 2006
Update of /cvsroot/nagiosplug/Nagios-Plugin/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv11863/t
Modified Files:
Nagios-Plugin-Functions-02.t
Log Message:
Update Nagios::Plugin with NP::Function wrapper methods, and extras.
Index: Nagios-Plugin-Functions-02.t
===================================================================
RCS file: /cvsroot/nagiosplug/Nagios-Plugin/t/Nagios-Plugin-Functions-02.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Nagios-Plugin-Functions-02.t 26 Sep 2006 01:10:23 -0000 1.1
+++ Nagios-Plugin-Functions-02.t 26 Sep 2006 04:10:37 -0000 1.2
@@ -1,7 +1,7 @@
# check_messages tests
use strict;
-use Test::More tests => 33;
+use Test::More tests => 37;
BEGIN { use_ok("Nagios::Plugin::Functions", ":all") }
@@ -160,3 +160,19 @@
is($code, WARNING, "(warning) code is $STATUS_TEXT{$code}");
is($message, 'D E F', "join_all '$join_all' (critical, warning) message is $message");
+# -------------------------------------------------------------------------
+# Error cases
+
+# Test failures without required fields
+ok(! defined eval { ($code, $message) = check_messages() },
+ "check_messages dies without message args");
+
+ok(! defined eval { ($code, $message) = check_messages(warning => $arrays{warning}) },
+ "check_messages dies without 'critical' message");
+
+ok(! defined eval { ($code, $message) = check_messages(critical => $arrays{critical}) },
+ "check_messages dies without 'warning' message");
+
+ok(defined eval { ($code, $message) = check_messages(critical => $arrays{critical}, warning => $arrays{warning}) },
+ "check_messages ok with 'critical' and 'warning' messages");
+
More information about the Commits
mailing list