From d8f912e8f5abb1476366cfea6e0fb368a9669ec4 Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Mon, 25 Sep 2006 18:40:20 +0000 Subject: 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 --- t/Nagios-Plugin.t | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 't') 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 @@ use strict; -use Test::More tests => 9; +use Test::More tests => 12; BEGIN { use_ok('Nagios::Plugin') }; @@ -13,6 +13,13 @@ my $p = Nagios::Plugin->new; 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" ); -- cgit v1.2.3-74-g34f1