diff options
author | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2012-06-28 22:49:41 -0400 |
---|---|---|
committer | Thomas Guyot-Sionnest <dermoth@aei.ca> | 2012-06-28 22:49:41 -0400 |
commit | bacb16365718f55bbb09f9d990011e3829691f16 (patch) | |
tree | 03a58f5042e559e680a49be47ef513b9dd7f7d2c /t/Nagios-Plugin-Getopt-03.t | |
parent | 9ce4c4c221ff9c5fe451aa9b927dc478e6feb9d9 (diff) | |
download | monitoring-plugin-perl-bacb16365718f55bbb09f9d990011e3829691f16.tar.gz |
Add new test - match on "die" error message
1. Add new test "class" where expected data is the error string caught
2. Add new test exposing a bug where default file used is not shown, ex:
Invalid section 'bad_section' in config file ''
Diffstat (limited to 't/Nagios-Plugin-Getopt-03.t')
-rw-r--r-- | t/Nagios-Plugin-Getopt-03.t | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/t/Nagios-Plugin-Getopt-03.t b/t/Nagios-Plugin-Getopt-03.t index 11443c8..560b782 100644 --- a/t/Nagios-Plugin-Getopt-03.t +++ b/t/Nagios-Plugin-Getopt-03.t | |||
@@ -96,7 +96,8 @@ for my $infile (glob File::Spec->catfile($tdir, 'input', $glob)) { | |||
96 | eval { $ng->getopts }; | 96 | eval { $ng->getopts }; |
97 | if ($@) { | 97 | if ($@) { |
98 | chomp $@; | 98 | chomp $@; |
99 | ok($infile =~ m/_dies?$/, "$infile ($@)"); | 99 | ok($infile =~ m/_(dies?|catch)$/, "$infile ($@)"); |
100 | is($@, $EXPECTED{$infile}, $infile) if ($infile =~ m/_catch$/); | ||
100 | } | 101 | } |
101 | else { | 102 | else { |
102 | is($plugin . ' ' . $ng->_cmdline, $EXPECTED{$infile}, $infile); | 103 | is($plugin . ' ' . $ng->_cmdline, $EXPECTED{$infile}, $infile); |