line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Object::Quick; |
2
|
1
|
|
|
1
|
|
31300
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
44
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
30
|
|
4
|
|
|
|
|
|
|
|
5
|
1
|
|
|
1
|
|
1017
|
use Mock::Quick::Object; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
26
|
|
6
|
1
|
|
|
1
|
|
7
|
use Mock::Quick::Method; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
29
|
|
7
|
1
|
|
|
1
|
|
5
|
use Mock::Quick::Util; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
96
|
|
8
|
1
|
|
|
1
|
|
6
|
use Carp qw/croak carp/; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
476
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
5
|
|
|
5
|
|
15661
|
carp "Object::Quick is depricated, use Mock::Quick instead."; |
13
|
5
|
|
|
|
|
42
|
my $class = shift; |
14
|
5
|
|
|
|
|
11
|
my $caller = caller; |
15
|
5
|
|
|
|
|
9
|
my ( @names, %args ); |
16
|
5
|
|
|
|
|
87
|
for my $i ( @_ ) { |
17
|
7
|
100
|
|
|
|
22
|
if( $i =~ m/^-/ ) { |
18
|
1
|
|
|
|
|
6
|
$args{$i}++; |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
else { |
21
|
6
|
|
|
|
|
14
|
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
|
|
|
26
|
$names[2] ||= 'clear'; |
29
|
|
|
|
|
|
|
} |
30
|
|
|
|
|
|
|
|
31
|
5
|
50
|
|
|
|
15
|
croak <<EOT if $args{'-class'}; |
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
|
|
161
|
inject( $caller, $names[0], sub { Mock::Quick::Object->new( @_ )}) if $names[0]; |
|
2
|
|
|
|
|
15
|
|
38
|
5
|
100
|
|
2
|
|
27
|
inject( $caller, $names[1], sub(&) { Mock::Quick::Method->new( @_ )}) if $names[1]; |
|
2
|
|
|
|
|
1284
|
|
39
|
5
|
100
|
|
2
|
|
27
|
inject( $caller, $names[2], sub { \$Mock::Quick::Util::CLEAR }) if $names[2]; |
|
2
|
|
|
|
|
684
|
|
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
=head1 NAME |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
Object::Quick - Depricated, see L<Mock::Quick> |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=head1 DESCRIPTION |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
Legacy interface to L<Mock::Quick> |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
=head1 AUTHORS |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
Chad Granum L<exodist7@gmail.com> |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
=head1 COPYRIGHT |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
Copyright (C) 2011 Chad Granum |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
Mock-Quick is free software; Standard perl licence. |
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
Mock-Quick is distributed in the hope that it will be useful, but WITHOUT ANY |
65
|
|
|
|
|
|
|
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A |
66
|
|
|
|
|
|
|
PARTICULAR PURPOSE. See the license for more details. |