lib/App/WRT/Mock/FileIO.pm

filter: Statementstmt 60.7% 17 / 28 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 5 / 10 Podpod 0.0% 0 / 6 totaltotal 50.0% 22 / 44 CC 1 SCAR 4.1
CC
1
Cov
61%
dir_list
2.0
file_put_contents
2.0
file_get_contents
2.0
CRAP 1.5
« blib/lib/App/WRT/Date.pm ↑ Summary blib/lib/App/WRT/Sort.pm »
1 package App::WRT::Mock::FileIO;
2  
3 # Partially mock FileIO (the write operations - reads are still done as
4 # usual).
5  
6 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 1 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use App::WRT::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 1 ▶sub new {
Subroutine new: called CC=1 SCAR=0.0
Pod undocumented
13 1 my $class = shift;
14  
15 1 my %params = (
16 'io' => App::WRT::FileIO->new(),
17 'file_contents' => { },
18 );
19  
20 1 my $self = \%params;
21 1 bless $self, $class;
22 }
23  
24 0 ▶sub dir_list {
Subroutine dir_list: not called CC=1 SCAR=6.9
Pod undocumented
25 0 my $self = shift;
26 0 return $self->{io}->dir_list(@_);
27 }
28  
29 0 ▶sub file_put_contents {
Subroutine file_put_contents: not called CC=1 SCAR=6.9
Pod undocumented
30 0 my $self = shift;
31 0 my ($file, $contents) = @_;
32 0 $self->{file_contents}->{$file} = $contents;
33 }
34  
35 0 ▶sub file_get_contents {
Subroutine file_get_contents: not called CC=1 SCAR=6.9
Pod undocumented
36 0 my $self = shift;
37 0 return $self->{io}->file_get_contents(@_);
38 }
39  
40 0 ▶sub file_copy {
Subroutine file_copy: not called CC=1 SCAR=6.9
Pod undocumented
41 0 my ($self, $source, $dest) = @_;
42 }
43  
44 0 ▶sub dir_make {
Subroutine dir_make: not called CC=1 SCAR=6.9
Pod undocumented
45 0 my ($self, $path) = @_;
46 0 my $path_err;
47 0 return 1;
48 }
49  
50 1 1;
« blib/lib/App/WRT/Date.pm ↑ Summary blib/lib/App/WRT/Sort.pm »