From e63887eda6765e1059939ff9c89e4fb244b5819b Mon Sep 17 00:00:00 2001 From: Gavin Carr Date: Wed, 4 Oct 2006 22:02:39 +0000 Subject: Fix NP shortname defaulting; downgrade version requirements. git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1489 f882894a-f735-0410-b71e-b25c423dba1c --- t/Nagios-Plugin-02.t | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 't/Nagios-Plugin-02.t') diff --git a/t/Nagios-Plugin-02.t b/t/Nagios-Plugin-02.t index 8f25cff..360e180 100644 --- a/t/Nagios-Plugin-02.t +++ b/t/Nagios-Plugin-02.t @@ -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 @@ for (@ok) { $_->[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'"); +} + -- cgit v1.2.3-74-g34f1