summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorTon Voon <tonvoon@users.sourceforge.net>2006-09-25 18:40:20 +0000
committerTon Voon <tonvoon@users.sourceforge.net>2006-09-25 18:40:20 +0000
commitd8f912e8f5abb1476366cfea6e0fb368a9669ec4 (patch)
treedfe890aa42474694cbc2d20532c33b62595294c4 /t
parente0486d70c246c59d28a8ffdc042e9b8010978d2d (diff)
downloadmonitoring-plugin-perl-d8f912e8f5abb1476366cfea6e0fb368a9669ec4.tar.gz
Fix Nagios::Plugin->new( shortname => "ANYTHING" ); (Wolfgang Barth)
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1481 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 't')
-rw-r--r--t/Nagios-Plugin.t9
1 files changed, 8 insertions, 1 deletions
diff --git a/t/Nagios-Plugin.t b/t/Nagios-Plugin.t
index 8921dc5..213e514 100644
--- a/t/Nagios-Plugin.t
+++ b/t/Nagios-Plugin.t
@@ -1,6 +1,6 @@
1 1
2use strict; 2use strict;
3use Test::More tests => 9; 3use Test::More tests => 12;
4 4
5BEGIN { use_ok('Nagios::Plugin') }; 5BEGIN { use_ok('Nagios::Plugin') };
6 6
@@ -13,6 +13,13 @@ my $p = Nagios::Plugin->new;
13isa_ok( $p, "Nagios::Plugin"); 13isa_ok( $p, "Nagios::Plugin");
14 14
15$p->shortname("PAGESIZE"); 15$p->shortname("PAGESIZE");
16is($p->shortname, "PAGESIZE", "shortname set correctly");
17
18$p = Nagios::Plugin->new;
19ok(! defined $p->shortname, "shortname should be unset on new");
20
21$p = Nagios::Plugin->new( shortname => "SIZE" );
22is($p->shortname, "SIZE", "shortname set correctly on new");
16 23
17diag "warn if < 10, critical if > 25 " if $ENV{TEST_VERBOSE}; 24diag "warn if < 10, critical if > 25 " if $ENV{TEST_VERBOSE};
18my $t = $p->set_thresholds( warning => "10:25", critical => "~:25" ); 25my $t = $p->set_thresholds( warning => "10:25", critical => "~:25" );