use reusable I/O utils, more solid error handling
[scpubgit/System-Introspector.git] / t / nagios-checkmkagent.t
CommitLineData
691c1b33 1use strictures 1;
2use Test::More;
3
4use System::Introspector::Nagios::CheckMkAgent;
5
6no warnings 'redefine';
7*System::Introspector::Nagios::CheckMkAgent::_get_check_mk_agent_output = sub {
8 return map "$_\n",
9 '<<<foo>>>',
10 'bar',
11 'baz',
12 '<<<bar>>>',
13 '<<<baz>>>',
14 'qux';
15};
16
17my $probe = System::Introspector::Nagios::CheckMkAgent->new;
18my $data = $probe->gather;
19
20is_deeply $data,
21 { foo => [qw( bar baz )], bar => [], baz => [qw( qux )] },
22 'output parsing worked';
23
24done_testing;