a9562ea42c1be5c0ee9200974f96a295ed457fc7
[scpubgit/System-Introspector.git] / t / filehandles.t
1 use strictures 1;
2 use Test::More;
3
4 use System::Introspector::Probe::FileHandles;
5
6 my $probe = System::Introspector::Probe::FileHandles->new;
7
8 my $data = $probe->gather;
9 ok($data, 'received result');
10
11 my $handles = $data->{handles};
12 ok($handles, 'received filehandle data');
13 ok(not(grep { not keys %$_ } @$handles), 'keys in all entries');
14
15 do {
16     my $fail_probe = System::Introspector::Probe::FileHandles->new(
17         lsof_command => 'lsoffakethisonedoesntexistatleastihopenot',
18     );
19     my $fail_data;
20     $fail_data = $fail_probe->gather;
21     ok $fail_data, 'received data';
22 };
23
24 done_testing;