summaryrefslogtreecommitdiffstats
path: root/t/Nagios-Plugin-02.t
diff options
context:
space:
mode:
Diffstat (limited to 't/Nagios-Plugin-02.t')
-rw-r--r--t/Nagios-Plugin-02.t15
1 files changed, 14 insertions, 1 deletions
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 @@
1# Nagios::Plugin test set 2, testing NP::Functions wrapping
1 2
2use strict; 3use strict;
3use Test::More tests => 101; 4use Test::More tests => 103;
4 5
5BEGIN { use_ok("Nagios::Plugin") } 6BEGIN { use_ok("Nagios::Plugin") }
6require Nagios::Plugin::Functions; 7require Nagios::Plugin::Functions;
@@ -146,3 +147,15 @@ for (@ok) {
146 $_->[1] . '.*' . $_->[2])); 147 $_->[1] . '.*' . $_->[2]));
147} 148}
148 149
150
151# shortname testing
152SKIP: {
153 skip "requires File::Basename", 2 unless eval { require File::Basename };
154 $np = Nagios::Plugin->new;
155 $plugin = uc File::Basename::basename($0);
156 $plugin =~ s/\..*$//;
157 is($np->shortname, $plugin, "shortname() is '$plugin'");
158 $r = $np->nagios_exit(OK, "foobar");
159 like($r->message, qr/^$plugin OK/, "message begins with '$plugin OK'");
160}
161