PObject/Test.pm

filter: Statementstmt 86.3% 19 / 22 Branchbran 50.0% 1 / 2 Conditioncond 33.3% 2 / 6 MC/DCmcdc 0.0% 0 / 4 Subroutinesub 83.3% 5 / 6 Podpod 0.0% 0 / 2 totaltotal 64.2% 27 / 42 CC 4 SCAR 11.0
CC
4
Cov
73%
new
5.3
run
2.0
BEGIN
1.0
CRAP 3.0
« PObject/Driver/db_file.pm ↑ Summary PObject/Type.pm »
1 package Class::PObject::Test;
2  
3 # Test.pm,v 1.5 2005/02/20 18:05:00 sherzodr Exp
4  
5 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 #use diagnostics;
7 3 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 ▶use Class::PObject;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 3 ▶use vars ('$VERSION');
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 $VERSION = '1.02';
12  
13 3 ▶sub new {
Subroutine new: called CC=4 SCAR=16.6
Pod undocumented
14 3 my $class = shift;
15 3 ▶ $class = ref($class) || $class;
Condition33%1/3
ref $class || $class
l!l&&r!l&&!r
030
MC/DC0%0/2
ref $class || $class
ref $class $class
Truth table33%1/3
A || B
A= ref $classB= $class
ABresult
1X1
011
000
16  
17 3 my $self = bless {
18 driver => $_[0], # || 'file',
19 datasource => $_[1] # || 'data'
20 }, $class;
21  
22 3 ▶ unless ( $self->{driver} && $self->{datasource} ) {
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"driver"} and $self->{"datasource"}) 0 3 3
Condition33%1/3
$self->{"driver"} and $self->{"datasource"}
!ll&&!rl&&r
003
MC/DC0%0/2
$self->{"driver"} and $self->{"datasource"}
$self->{"driver"} $self->{"datasource"}
Truth table33%1/3
A and B
A= $self->{"driver"}B= $self->{"datasource"}
ABresult
0X0
100
111
23 0 croak "'driver' and 'datasource' are not set in the test script";
24 }
25 3 return $self;
26 }
27  
28  
29 0 ▶sub run {
Subroutine run: not called CC=1 SCAR=6.9
Pod undocumented
30 0 my $self = shift;
31  
32 0 croak "You should override run() method in your test class";
33  
34 }
35  
36 3 1;
37 __END__
« PObject/Driver/db_file.pm ↑ Summary PObject/Type.pm »