line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Mock::Quick::Object::Control; |
2
|
7
|
|
|
7
|
|
33
|
use strict; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
232
|
|
3
|
7
|
|
|
7
|
|
35
|
use warnings; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
220
|
|
4
|
7
|
|
|
7
|
|
35
|
use Mock::Quick::Util; |
|
7
|
|
|
|
|
8
|
|
|
7
|
|
|
|
|
550
|
|
5
|
7
|
|
|
7
|
|
41
|
use Mock::Quick::Object; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
285
|
|
6
|
7
|
|
|
7
|
|
38
|
use Mock::Quick::Method; |
|
7
|
|
|
|
|
20
|
|
|
7
|
|
|
|
|
4565
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
our %META; |
9
|
|
|
|
|
|
|
|
10
|
258
|
|
|
258
|
0
|
900
|
sub target { shift->{target} } |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub new { |
13
|
101
|
|
|
101
|
1
|
98
|
my $class = shift; |
14
|
101
|
|
|
|
|
101
|
my ( $target ) = @_; |
15
|
101
|
|
|
|
|
276
|
return bless( { target => $target }, $class ); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub set_methods { |
19
|
2
|
|
|
2
|
1
|
320
|
my $self = shift; |
20
|
2
|
|
|
|
|
7
|
my %params = @_; |
21
|
2
|
|
|
|
|
8
|
for my $key ( keys %params ) { |
22
|
2
|
|
|
|
|
11
|
$self->target->{$key} = Mock::Quick::Method->new( $params{$key} ); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
sub set_attributes { |
27
|
1
|
|
|
1
|
1
|
4
|
my $self = shift; |
28
|
1
|
|
|
|
|
2
|
my %params = @_; |
29
|
1
|
|
|
|
|
3
|
for my $key ( keys %params ) { |
30
|
1
|
|
|
|
|
2
|
$self->target->{$key} = $params{$key}; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
sub clear { |
35
|
2
|
|
|
2
|
1
|
4
|
my $self = shift; |
36
|
2
|
|
|
|
|
5
|
for my $field ( @_ ) { |
37
|
2
|
|
|
|
|
4
|
delete $self->target->{$field}; |
38
|
2
|
|
|
|
|
4
|
delete $self->metrics->{$field}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
sub strict { |
43
|
92
|
|
|
92
|
1
|
2246
|
my $self = shift; |
44
|
92
|
100
|
|
|
|
170
|
($META{$self->target}->{strict}) = @_ if @_; |
45
|
92
|
|
|
|
|
112
|
return $META{$self->target}->{strict}; |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
sub metrics { |
49
|
70
|
|
|
70
|
1
|
61
|
my $self = shift; |
50
|
70
|
|
100
|
|
|
87
|
$META{$self->target}->{metrics} ||= {}; |
51
|
70
|
|
|
|
|
93
|
return $META{$self->target}->{metrics}; |
52
|
|
|
|
|
|
|
} |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
sub _clean { |
55
|
13
|
|
|
13
|
|
17
|
my $self = shift; |
56
|
13
|
|
|
|
|
25
|
delete $META{$self->target}; |
57
|
|
|
|
|
|
|
} |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
purge_util(); |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
__END__ |