lib/Rex/Test/Base/has_content.pm

filter: Statementstmt 56.5% 13 / 23 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 66.6% 4 / 6 Podpod 50.0% 1 / 2 totaltotal 47.3% 18 / 38 CC 3 SCAR 12.5
CC
3
Cov
46%
new
6.0
run_test
6.0
BEGIN
1.0
CRAP 3.5
« lib/Rex/PkgConf/Base.pm ↑ Summary lib/Rex/CMDB/YAML.pm »
1 #
2 # (c) Jan Gehring <jan.gehring@gmail.com>
3 #
4  
5 package Rex::Test::Base::has_content;
6  
7 1 ▶use v5.14.4;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 our $VERSION = '1.16.1'; # VERSION
11  
12 1 ▶use Rex -base;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 1 ▶use base qw(Rex::Test::Base);
Subroutine BEGIN: called CC=1 SCAR=0.0
14  
15 0 ▶sub new {
Subroutine new: not called CC=2 SCAR=17.9
Pod documented
16 0 my $that = shift;
17 0 ▶ my $proto = ref($that) || $that;
Condition0%0/3
ref $that || $that
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $that || $that
ref $that $that
Truth table0%0/3
A || B
A= ref $thatB= $that
ABresult
1X1
011
000
18 0 my $self = {@_};
19  
20 0 bless( $self, $proto );
21  
22 0 my ( $pkg, $file ) = caller(0);
23  
24 0 return $self;
25 }
26  
27 0 ▶sub run_test {
Subroutine run_test: not called CC=2 SCAR=17.9
Pod undocumented
28 0 my ( $self, $file, $test ) = @_;
29  
30 0 ▶ return $self->ok( 0, "has_content: $file not found" ) unless is_file($file);
Branch: 1 branch
BranchTrueFalseTotal
unless is_file($file) 0 0 0
31  
32 0 my $content = cat $file;
33 0 $self->ok( ( $content =~ $test ) >= 1, "Content of $file contain $test." );
34 }
35  
36 1 1;
« lib/Rex/PkgConf/Base.pm ↑ Summary lib/Rex/CMDB/YAML.pm »