[Nagios-Plugin] Test for exported variable %STATUS_TEXT (Andrew ...

"Ton Voon" <[email protected]>
Newsgroups gmane.network.nagios.plugins.cvs
Message-ID <[email protected]>
 Module: Nagios-Plugin
 Branch: master
 Commit: d2ea3cc29ea66a29d6dfa54dcd394d972ae97ef8
 Author: tonvoon <[email protected]>
   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( $@, '' );
+


------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.