Infrastructure/Compare.pm

filter: Statementstmt 67.6% 23 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 60.0% 6 / 10 Podpod 0.0% 0 / 1 totaltotal 64.4% 29 / 45 CC 1 SCAR 3.4
CC
1
Cov
68%
S
2.0
__ANON__
2.0
__ANON__
2.0
CRAP 1.4
« Infrastructure/SystemUser.pm ↑ Summary Infrastructure/Config/YAML.pm »
1 package Test::BDD::Infrastructure::Compare;
2  
3 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 1 our $VERSION = '1.005'; # VERSION
7 # ABSTRACT: cucumber step definitions for comparsion checks
8
9 1 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶use Test::BDD::Cucumber::StepFile qw( Given When Then );
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 0 ▶sub S { Test::BDD::Cucumber::StepFile::S }
Subroutine S: not called CC=1 SCAR=6.9
Pod undocumented
13  
14 1 ▶use Test::BDD::Infrastructure::Utils qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
15 1 convert_cmp_operator $CMP_OPERATOR_RE lookup_config);
16  
17 1 ▶use File::Slurp;
Subroutine BEGIN: called CC=1 SCAR=0.0
18  
19  
20 0 ▶Then qr/the value (\S+) must be like (.*)/, sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
21 0 my $value = lookup_config( $1 );
22 0 my $regex = $2;
23 0 like( $value, qr/$regex/, "the value $value must be like $regex");
24 1 };
25 0 ▶Then qr/the value (\S+) must be unlike (.*)/, sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
26 0 my $value = lookup_config( $1 );
27 0 my $regex = $2;
28 0 unlike( $value, qr/$regex/, "the value $value must be unlike $regex");
29 1 };
30  
31 0 ▶Then qr/the value (\S+) must be $CMP_OPERATOR_RE (.*)/, sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
32 0 my $value = lookup_config( $1 );
33 0 my $op = convert_cmp_operator( $2 );
34 0 my $count = $3;
35 0 cmp_ok( $value, $op, $count, "the value $value $op $count");
36 1 };
37  
38 1 1;
39  
40 __END__
« Infrastructure/SystemUser.pm ↑ Summary Infrastructure/Config/YAML.pm »