| 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
| |||||||||||||
| 18 | 1 | $args{$i}++; | |||||||||||
| 19 | } | ||||||||||||
| 20 | else { | ||||||||||||
| 21 | 6 | push @names => $i; | |||||||||||
| 22 | } | ||||||||||||
| 23 | } | ||||||||||||
| 24 | |||||||||||||
| 25 | 5 | ▶ | if ( $args{'-obj'} ) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 26 | 1 | ▶ | $names[0] ||= 'obj'; | ||||||||||
|
Condition50%1/2
$names[0] ||= "obj"
MC/DC0%0/1
$names[0] ||= "obj"
$names[0]
Truth table50%1/2
A
A= $names[0]
| |||||||||||||
| 27 | 1 | ▶ | $names[1] ||= 'method'; | ||||||||||
|
Condition50%1/2
$names[1] ||= "method"
MC/DC0%0/1
$names[1] ||= "method"
$names[1]
Truth table50%1/2
A
A= $names[1]
| |||||||||||||
| 28 | 1 | ▶ | $names[2] ||= 'clear'; | ||||||||||
|
Condition50%1/2
$names[2] ||= "clear"
MC/DC0%0/1
$names[2] ||= "clear"
$names[2]
Truth table50%1/2
A
A= $names[2]
| |||||||||||||
| 29 | } | ||||||||||||
| 30 | |||||||||||||
| 31 | 5 | ▶ | croak <<EOT if $args{'-class'}; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 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
| |||||||||||||
| 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
| |||||||||||||
| 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
| |||||||||||||
| 40 | } | ||||||||||||
| 41 | |||||||||||||
| 42 | 1 | 1; | |||||||||||
| 43 | |||||||||||||
| 44 | __END__ | ||||||||||||