From d2ea3cc29ea66a29d6dfa54dcd394d972ae97ef8 Mon Sep 17 00:00:00 2001 From: tonvoon Date: Thu, 15 Apr 2010 08:50:30 +0000 Subject: Test for exported variable %STATUS_TEXT (Andrew Ford - RT46048) --- t/Nagios-Plugin-05.t | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 t/Nagios-Plugin-05.t (limited to 't') 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( $@, '' ); + -- cgit v1.2.3-74-g34f1