[Nagiosplug-checkins] Nagios-Plugin/t Nagios-Plugin.t,1.3,1.4

Ton Voon tonvoon at users.sourceforge.net
Mon Sep 25 20:40:22 CEST 2006


Update of /cvsroot/nagiosplug/Nagios-Plugin/t
In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv6692/t

Modified Files:
	Nagios-Plugin.t 
Log Message:
Fix Nagios::Plugin->new( shortname => "ANYTHING" ); (Wolfgang Barth)


Index: Nagios-Plugin.t
===================================================================
RCS file: /cvsroot/nagiosplug/Nagios-Plugin/t/Nagios-Plugin.t,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- Nagios-Plugin.t	11 Sep 2006 01:57:26 -0000	1.3
+++ Nagios-Plugin.t	25 Sep 2006 18:40:20 -0000	1.4
@@ -1,6 +1,6 @@
 
 use strict;
-use Test::More tests => 9;
+use Test::More tests => 12;
 
 BEGIN { use_ok('Nagios::Plugin') };
 
@@ -13,6 +13,13 @@
 isa_ok( $p, "Nagios::Plugin");
 
 $p->shortname("PAGESIZE");
+is($p->shortname, "PAGESIZE", "shortname set correctly");
+
+$p = Nagios::Plugin->new;
+ok(! defined $p->shortname, "shortname should be unset on new");
+
+$p = Nagios::Plugin->new( shortname => "SIZE" );
+is($p->shortname, "SIZE", "shortname set correctly on new");
 
 diag "warn if < 10, critical if > 25 " if $ENV{TEST_VERBOSE};
 my $t = $p->set_thresholds( warning => "10:25", critical => "~:25" );





More information about the Commits mailing list