[Nagios-Plugin] Test for exported variable %STATUS_TEXT (Andrew ...
Ton Voon
tonvoon at users.sourceforge.net
Thu Apr 15 11:40:19 CEST 2010
Module: Nagios-Plugin
Branch: master
Commit: d2ea3cc29ea66a29d6dfa54dcd394d972ae97ef8
Author: tonvoon <ton.voon at opsera.com>
Date: Thu Apr 15 08:50:30 2010 +0000
URL: http://nagiosplug.git.sf.net/git/gitweb.cgi?p=nagiosplug/Nagios-Plugin;a=commit;h=d2ea3cc
Test for exported variable %STATUS_TEXT (Andrew Ford - RT46048)
---
Changes | 1 +
t/Nagios-Plugin-05.t | 16 ++++++++++++++++
2 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/Changes b/Changes
index 64b8a56..6061e61 100644
--- a/Changes
+++ b/Changes
@@ -3,6 +3,7 @@ Revision history for Perl module Nagios::Plugin.
0.34 15th April 2010
- Amended standard --extra-opts help
- pod fix (Frank Wiegand - RT51872)
+ - Added %STATUS_TEXT to valid possible exports (Andrew Ford - RT46048)
0.33 5th June 2009
- 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 @@
+# Check for exported vars
+# Can't include Nagios::Plugin::Functions because it also exports %STATUS_TEXT
+
+use strict;
+use Test::More tests=>4;
+
+BEGIN { use_ok('Nagios::Plugin') };
+
+eval ' $_ = $STATUS_TEXT{0} ';
+like( $@, '/Global symbol "%STATUS_TEXT" requires explicit package name/' );
+
+use_ok("Nagios::Plugin", qw(%STATUS_TEXT));
+
+eval ' $_ = $STATUS_TEXT{0} ';
+is( $@, '' );
+
More information about the Commits
mailing list