File Coverage

blib/lib/System/Introspector/Probe/Hosts.pm
Criterion Covered Total %
statement 10 10 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 14 15 93.3


line stmt bran cond sub pod time code
1             package System::Introspector::Probe::Hosts;
2 1     1   34979 use Moo;
  1         26691  
  1         8  
3              
4 1         253 use System::Introspector::Util qw(
5             output_from_file
6             transform_exceptions
7 1     1   6327 );
  1         4  
8              
9             has hosts_file => (
10             is => 'ro',
11             default => sub { '/etc/hosts' },
12             );
13              
14             sub gather {
15 1     1 0 1339 my ($self) = @_;
16 1         5 my $file = $self->hosts_file;
17             return {
18             hosts_file => transform_exceptions {
19             return {
20 1     1   9 file_name => $file,
21             body => scalar output_from_file $file,
22             };
23             },
24 1         10 };
25             }
26              
27             1;
28              
29             __END__