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