Object/Quick.pm

filter: Statementstmt 100% 38 / 38 Branchbran 91.6% 11 / 12 Conditioncond 50.0% 3 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 89.8% 62 / 69 CC 11 SCAR 18.8
CC
11
Cov
93%
import
11.2
BEGIN
1.0
BEGIN
1.0
CRAP 6.6
↑ Summary Mock/Quick/Util.pm »
1 package Object::Quick;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 1 ▶use Mock::Quick::Object;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 1 ▶use Mock::Quick::Method;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 1 ▶use Mock::Quick::Util;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Carp qw/croak carp/;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 5 ▶sub import {
Subroutine import: called CC=11 SCAR=24.1
12 5 carp "Object::Quick is depricated, use Mock::Quick instead.";
13 5 my $class = shift;
14 5 my $caller = caller;
15 5 my ( @names, %args );
16 5 for my $i ( @_ ) {
17 7 ▶ if( $i =~ m/^-/ ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($i =~ /^-/) { } 1 6 7
18 1 $args{$i}++;
19 }
20 else {
21 6 push @names => $i;
22 }
23 }
24  
25 5 ▶ if ( $args{'-obj'} ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($args{"-obj"}) 1 4 5
26 1 ▶ $names[0] ||= 'obj';
Condition50%1/2
$names[0] ||= "obj"
l!l
01
MC/DC0%0/1
$names[0] ||= "obj"
$names[0]
Truth table50%1/2
A
A= $names[0]
Aresult
11
00
27 1 ▶ $names[1] ||= 'method';
Condition50%1/2
$names[1] ||= "method"
l!l
01
MC/DC0%0/1
$names[1] ||= "method"
$names[1]
Truth table50%1/2
A
A= $names[1]
Aresult
11
00
28 1 ▶ $names[2] ||= 'clear';
Condition50%1/2
$names[2] ||= "clear"
l!l
01
MC/DC0%0/1
$names[2] ||= "clear"
$names[2]
Truth table50%1/2
A
A= $names[2]
Aresult
11
00
29 }
30  
31 5 ▶ croak <<EOT if $args{'-class'};
Branch: 1 branch
BranchTrueFalseTotal
if $args{"-class"} 0 5 5
32 '-class' is no longer supported as of V1.0
33 if you use this functionality send me an email at exodist7\@gmail.com
34 I will add it in.
35 EOT
36  
37 5 ▶ inject( $caller, $names[0], sub { Mock::Quick::Object->new( @_ )}) if $names[0];
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if $names[0] 4 1 5
38 5 ▶ inject( $caller, $names[1], sub(&) { Mock::Quick::Method->new( @_ )}) if $names[1];
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if $names[1] 3 2 5
39 5 ▶ inject( $caller, $names[2], sub { \$Mock::Quick::Util::CLEAR }) if $names[2];
Subroutine __ANON__: called CC=1 SCAR=0.0
Branch: 1 branch
BranchTrueFalseTotal
if $names[2] 2 3 5
40 }
41  
42 1 1;
43  
44 __END__
↑ Summary Mock/Quick/Util.pm »