From: Robert 'phaylon' Sedlacek Date: Wed, 9 May 2012 21:23:06 +0000 (+0000) Subject: Nagios::CheckMkAgent probe tests X-Git-Tag: v0.001_001~104 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=691c1b330da6048084d36cab974c1a1f0c678e5f;p=scpubgit%2FSystem-Introspector.git Nagios::CheckMkAgent probe tests --- diff --git a/t/nagios-checkmkagent.t b/t/nagios-checkmkagent.t new file mode 100644 index 0000000..0ffcc08 --- /dev/null +++ b/t/nagios-checkmkagent.t @@ -0,0 +1,24 @@ +use strictures 1; +use Test::More; + +use System::Introspector::Nagios::CheckMkAgent; + +no warnings 'redefine'; +*System::Introspector::Nagios::CheckMkAgent::_get_check_mk_agent_output = sub { + return map "$_\n", + '<<>>', + 'bar', + 'baz', + '<<>>', + '<<>>', + 'qux'; +}; + +my $probe = System::Introspector::Nagios::CheckMkAgent->new; +my $data = $probe->gather; + +is_deeply $data, + { foo => [qw( bar baz )], bar => [], baz => [qw( qux )] }, + 'output parsing worked'; + +done_testing;