line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Object::Quick; |
2
|
1
|
|
|
1
|
|
16692
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
24
|
|
3
|
1
|
|
|
1
|
|
3
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
20
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
305
|
use Mock::Quick::Object; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
19
|
|
6
|
1
|
|
|
1
|
|
4
|
use Mock::Quick::Method; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
11
|
|
7
|
1
|
|
|
1
|
|
3
|
use Mock::Quick::Util; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
44
|
|
8
|
1
|
|
|
1
|
|
3
|
use Carp qw/croak carp/; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
281
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
5
|
|
|
5
|
|
9763
|
carp "Object::Quick is depricated, use Mock::Quick instead."; |
13
|
5
|
|
|
|
|
48
|
my $class = shift; |
14
|
5
|
|
|
|
|
9
|
my $caller = caller; |
15
|
5
|
|
|
|
|
6
|
my ( @names, %args ); |
16
|
5
|
|
|
|
|
10
|
for my $i ( @_ ) { |
17
|
7
|
100
|
|
|
|
17
|
if( $i =~ m/^-/ ) { |
18
|
1
|
|
|
|
|
4
|
$args{$i}++; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
else { |
21
|
6
|
|
|
|
|
10
|
push @names => $i; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
5
|
100
|
|
|
|
19
|
if ( $args{'-obj'} ) { |
26
|
1
|
|
50
|
|
|
7
|
$names[0] ||= 'obj'; |
27
|
1
|
|
50
|
|
|
5
|
$names[1] ||= 'method'; |
28
|
1
|
|
50
|
|
|
783
|
$names[2] ||= 'clear'; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
5
|
50
|
|
|
|
11
|
croak <
|
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
|
100
|
|
2
|
|
30
|
inject( $caller, $names[0], sub { Mock::Quick::Object->new( @_ )}) if $names[0]; |
|
2
|
|
|
|
|
12
|
|
38
|
5
|
100
|
|
2
|
|
22
|
inject( $caller, $names[1], sub(&) { Mock::Quick::Method->new( @_ )}) if $names[1]; |
|
2
|
|
|
|
|
661
|
|
39
|
5
|
100
|
|
2
|
|
22
|
inject( $caller, $names[2], sub { \$Mock::Quick::Util::CLEAR }) if $names[2]; |
|
2
|
|
|
|
|
357
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |