From c6ee438b0525b73d36bbcf5e5a9e0d445f69129b Mon Sep 17 00:00:00 2001 From: Ton Voon Date: Fri, 31 Aug 2007 14:34:18 +0000 Subject: Convenience function to set use_die on use of N::P::Performance git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/Nagios-Plugin/trunk@1773 f882894a-f735-0410-b71e-b25c423dba1c --- t/Nagios-Plugin-Performance-02.t | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 t/Nagios-Plugin-Performance-02.t (limited to 't') diff --git a/t/Nagios-Plugin-Performance-02.t b/t/Nagios-Plugin-Performance-02.t new file mode 100644 index 0000000..c0c5a71 --- /dev/null +++ b/t/Nagios-Plugin-Performance-02.t @@ -0,0 +1,13 @@ + +use strict; +use Test::More tests => 3; +use_ok("Nagios::Plugin::Performance", use_die => 1); + +eval { Nagios::Plugin::Functions::nagios_die("Testing") }; +is( $@, "NAGIOS-PLUGIN-PERFORMANCE-02 UNKNOWN - Testing\n", "use_die correctly set on import"); + + +use_ok("Nagios::Plugin::Performance"); +eval { Nagios::Plugin::Functions::nagios_die("Test OK exit", 0) }; + +fail("Should not get here if code works correctly because prior nagios_die should have exited"); -- cgit v1.2.3-74-g34f1