Commit | Line | Data |
d52d96e6 |
1 | use strictures 1; |
2 | use Test::More; |
799e92b6 |
3 | use FindBin; |
d52d96e6 |
4 | |
afd7c030 |
5 | use System::Introspector::Probe::FileHandles; |
d52d96e6 |
6 | |
799e92b6 |
7 | $ENV{PATH} = "$FindBin::Bin/bin:" . $ENV{PATH}; |
8 | |
afd7c030 |
9 | my $probe = System::Introspector::Probe::FileHandles->new; |
d52d96e6 |
10 | |
df8adc95 |
11 | my $data = $probe->gather; |
12 | ok($data, 'received result'); |
13 | |
14 | my $handles = $data->{handles}; |
15 | ok($handles, 'received filehandle data'); |
16 | ok(not(grep { not keys %$_ } @$handles), 'keys in all entries'); |
d52d96e6 |
17 | |
9c3e454c |
18 | do { |
19 | my $fail_probe = System::Introspector::Probe::FileHandles->new( |
20 | lsof_command => 'lsoffakethisonedoesntexistatleastihopenot', |
21 | ); |
22 | my $fail_data; |
23 | $fail_data = $fail_probe->gather; |
24 | ok $fail_data, 'received data'; |
0c7501ff |
25 | like $fail_data->{__error__}, qr{lsoffake}, 'correct error is set'; |
9c3e454c |
26 | }; |
27 | |
d52d96e6 |
28 | done_testing; |