diff options
Diffstat (limited to 't/Nagios-Plugin-01.t')
| -rw-r--r-- | t/Nagios-Plugin-01.t | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-01.t b/t/Nagios-Plugin-01.t index 3ada472..947a704 100644 --- a/t/Nagios-Plugin-01.t +++ b/t/Nagios-Plugin-01.t | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | # Nagios::Plugin original test cases | 1 | # Nagios::Plugin original test cases |
| 2 | 2 | ||
| 3 | use strict; | 3 | use strict; |
| 4 | use Test::More tests => 13; | 4 | use Test::More tests => 15; |
| 5 | 5 | ||
| 6 | BEGIN { use_ok('Nagios::Plugin') }; | 6 | BEGIN { use_ok('Nagios::Plugin') }; |
| 7 | 7 | ||
| @@ -23,6 +23,12 @@ is($p->shortname, "NAGIOS-PLUGIN-01", "shortname should default on new"); | |||
| 23 | $p = Nagios::Plugin->new( shortname => "SIZE", () ); | 23 | $p = Nagios::Plugin->new( shortname => "SIZE", () ); |
| 24 | is($p->shortname, "SIZE", "shortname set correctly on new"); | 24 | is($p->shortname, "SIZE", "shortname set correctly on new"); |
| 25 | 25 | ||
| 26 | $p = Nagios::Plugin->new( plugin => "check_stuff", () ); | ||
| 27 | is($p->shortname, "STUFF", "shortname uses plugin name as default"); | ||
| 28 | |||
| 29 | $p = Nagios::Plugin->new( shortname => "SIZE", plugin => "check_stuff", () ); | ||
| 30 | is($p->shortname, "SIZE", "shortname is not overriden by default"); | ||
| 31 | |||
| 26 | diag "warn if < 10, critical if > 25 " if $ENV{TEST_VERBOSE}; | 32 | diag "warn if < 10, critical if > 25 " if $ENV{TEST_VERBOSE}; |
| 27 | my $t = $p->set_thresholds( warning => "10:25", critical => "~:25" ); | 33 | my $t = $p->set_thresholds( warning => "10:25", critical => "~:25" ); |
| 28 | 34 | ||
