diff options
| author | tonvoon <ton.voon@opsera.com> | 2010-04-15 08:50:30 +0000 |
|---|---|---|
| committer | tonvoon <ton.voon@opsera.com> | 2010-04-15 08:50:30 +0000 |
| commit | d2ea3cc29ea66a29d6dfa54dcd394d972ae97ef8 (patch) | |
| tree | 23221bc6464ea139a6b28d17189f1775daae0eb5 | |
| parent | a625872ee35399c0ff69d95d8695feecaab7e79c (diff) | |
| download | monitoring-plugin-perl-d2ea3cc29ea66a29d6dfa54dcd394d972ae97ef8.tar.gz | |
Test for exported variable %STATUS_TEXT (Andrew Ford - RT46048)
| -rw-r--r-- | Changes | 1 | ||||
| -rw-r--r-- | t/Nagios-Plugin-05.t | 16 |
2 files changed, 17 insertions, 0 deletions
| @@ -3,6 +3,7 @@ Revision history for Perl module Nagios::Plugin. | |||
| 3 | 0.34 15th April 2010 | 3 | 0.34 15th April 2010 |
| 4 | - Amended standard --extra-opts help | 4 | - Amended standard --extra-opts help |
| 5 | - pod fix (Frank Wiegand - RT51872) | 5 | - pod fix (Frank Wiegand - RT51872) |
| 6 | - Added %STATUS_TEXT to valid possible exports (Andrew Ford - RT46048) | ||
| 6 | 7 | ||
| 7 | 0.33 5th June 2009 | 8 | 0.33 5th June 2009 |
| 8 | - Fixed infinite loop when invalid performance data with multiple = were present | 9 | - Fixed infinite loop when invalid performance data with multiple = were present |
diff --git a/t/Nagios-Plugin-05.t b/t/Nagios-Plugin-05.t new file mode 100644 index 0000000..cc602cc --- /dev/null +++ b/t/Nagios-Plugin-05.t | |||
| @@ -0,0 +1,16 @@ | |||
| 1 | # Check for exported vars | ||
| 2 | # Can't include Nagios::Plugin::Functions because it also exports %STATUS_TEXT | ||
| 3 | |||
| 4 | use strict; | ||
| 5 | use Test::More tests=>4; | ||
| 6 | |||
| 7 | BEGIN { use_ok('Nagios::Plugin') }; | ||
| 8 | |||
| 9 | eval ' $_ = $STATUS_TEXT{0} '; | ||
| 10 | like( $@, '/Global symbol "%STATUS_TEXT" requires explicit package name/' ); | ||
| 11 | |||
| 12 | use_ok("Nagios::Plugin", qw(%STATUS_TEXT)); | ||
| 13 | |||
| 14 | eval ' $_ = $STATUS_TEXT{0} '; | ||
| 15 | is( $@, '' ); | ||
| 16 | |||
