File Coverage

blib/lib/Device/CableModem/Zoom5341/Test.pm
Criterion Covered Total %
statement 19 19 100.0
branch 1 2 50.0
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 25 27 92.5


line stmt bran cond sub pod time code
1 2     2   1275 use strict;
  2         4  
  2         73  
2 2     2   11 use warnings;
  2         4  
  2         102  
3              
4             package Device::CableModem::Zoom5341;
5              
6              
7             =head1 NAME
8              
9             Device::CableModem::Zoom5341::Test
10              
11             =head1 NOTA BENE
12              
13             This is part of the guts of Device::CableModem::Zoom5341. If you're
14             reading this, you're either developing the module, writing tests, or
15             coloring outside the lines; consider yourself warned.
16              
17             =cut
18              
19              
20             =head2 ->load_test_data
21              
22             Loads sample data for tests
23             =cut
24             sub load_test_data
25             {
26 2     2 0 837 my $self = shift;
27              
28             # We're assuming this is run via 'make test'. Which is strictly
29             # speaking Wrong(tm). But it works well enough for now...
30             # overthink things when it becomes necessary.
31 2     2   11 use File::Basename qw(dirname);
  2         2  
  2         198  
32 2     2   11 use File::Spec;
  2         5  
  2         269  
33 2         174 my $sampledata = File::Spec->catfile(dirname($0), 'rf_connection.sample');
34 2 50       108 open my $sdf, '<', $sampledata or die "Couldn't load sample data: $@";
35 2         752 my @html = <$sdf>;
36 2         56 close $sdf;
37              
38 2         49 chomp @html;
39 2         20 $self->{conn_html} = \@html;
40             }
41              
42              
43             1;
44             __END__