Commit | Line | Data |
691c1b33 |
1 | use strictures 1; |
2 | use Test::More; |
3 | |
afd7c030 |
4 | use System::Introspector::Probe::Nagios::CheckMkAgent; |
691c1b33 |
5 | |
6 | no warnings 'redefine'; |
afd7c030 |
7 | *System::Introspector::Probe::Nagios::CheckMkAgent::_get_check_mk_agent_output = sub { |
691c1b33 |
8 | return map "$_\n", |
9 | '<<<foo>>>', |
10 | 'bar', |
11 | 'baz', |
12 | '<<<bar>>>', |
13 | '<<<baz>>>', |
14 | 'qux'; |
15 | }; |
16 | |
afd7c030 |
17 | my $probe = System::Introspector::Probe::Nagios::CheckMkAgent->new; |
691c1b33 |
18 | my $data = $probe->gather; |
19 | |
20 | is_deeply $data, |
7b3254fd |
21 | { nagios_check_mk_agent => { |
22 | foo => [qw( bar baz )], |
23 | bar => [], |
24 | baz => [qw( qux )], |
25 | } }, |
691c1b33 |
26 | 'output parsing worked'; |
27 | |
28 | done_testing; |