[Nagiosplug-checkins] Nagios-Plugin/t Nagios-Plugin-01.t, 1.1, 1.2 Nagios-Plugin-02.t, 1.1, 1.2
Gavin Carr
gonzai at users.sourceforge.net
Thu Oct 5 00:02:42 CEST 2006
- Previous message: [Nagiosplug-checkins] Nagios-Plugin/lib/Nagios/Plugin Functions.pm, 1.3, 1.4 Performance.pm, 1.7, 1.8 Range.pm, 1.5, 1.6 Threshold.pm, 1.7, 1.8
- Next message: [Nagiosplug-checkins] nagiosplug THANKS.in, 1.31, 1.32 NPTest.pm, 1.11, 1.12
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /cvsroot/nagiosplug/Nagios-Plugin/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv26225/t
Modified Files:
Nagios-Plugin-01.t Nagios-Plugin-02.t
Log Message:
Fix NP shortname defaulting; downgrade version requirements.
Index: Nagios-Plugin-01.t
===================================================================
RCS file: /cvsroot/nagiosplug/Nagios-Plugin/t/Nagios-Plugin-01.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Nagios-Plugin-01.t 26 Sep 2006 04:11:39 -0000 1.1
+++ Nagios-Plugin-01.t 4 Oct 2006 22:02:39 -0000 1.2
@@ -1,3 +1,4 @@
+# Nagios::Plugin original test cases
use strict;
use Test::More tests => 12;
@@ -17,7 +18,7 @@
is($p->shortname, "PAGESIZE", "shortname set correctly");
$p = Nagios::Plugin->new;
-ok(! defined $p->shortname, "shortname should be unset on new");
+is($p->shortname, "NAGIOS-PLUGIN-01", "shortname should default on new");
$p = Nagios::Plugin->new( shortname => "SIZE" );
is($p->shortname, "SIZE", "shortname set correctly on new");
Index: Nagios-Plugin-02.t
===================================================================
RCS file: /cvsroot/nagiosplug/Nagios-Plugin/t/Nagios-Plugin-02.t,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- Nagios-Plugin-02.t 26 Sep 2006 04:11:39 -0000 1.1
+++ Nagios-Plugin-02.t 4 Oct 2006 22:02:39 -0000 1.2
@@ -1,6 +1,7 @@
+# Nagios::Plugin test set 2, testing NP::Functions wrapping
use strict;
-use Test::More tests => 101;
+use Test::More tests => 103;
BEGIN { use_ok("Nagios::Plugin") }
require Nagios::Plugin::Functions;
@@ -146,3 +147,15 @@
$_->[1] . '.*' . $_->[2]));
}
+
+# shortname testing
+SKIP: {
+ skip "requires File::Basename", 2 unless eval { require File::Basename };
+ $np = Nagios::Plugin->new;
+ $plugin = uc File::Basename::basename($0);
+ $plugin =~ s/\..*$//;
+ is($np->shortname, $plugin, "shortname() is '$plugin'");
+ $r = $np->nagios_exit(OK, "foobar");
+ like($r->message, qr/^$plugin OK/, "message begins with '$plugin OK'");
+}
+
- Previous message: [Nagiosplug-checkins] Nagios-Plugin/lib/Nagios/Plugin Functions.pm, 1.3, 1.4 Performance.pm, 1.7, 1.8 Range.pm, 1.5, 1.6 Threshold.pm, 1.7, 1.8
- Next message: [Nagiosplug-checkins] nagiosplug THANKS.in, 1.31, 1.32 NPTest.pm, 1.11, 1.12
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the Commits
mailing list