line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Test::Mocha::MethodCall; |
2
|
|
|
|
|
|
|
# ABSTRACT: Objects to represent method calls |
3
|
|
|
|
|
|
|
$Test::Mocha::MethodCall::VERSION = '0.67'; |
4
|
13
|
|
|
13
|
|
89
|
use parent 'Test::Mocha::Method'; |
|
13
|
|
|
|
|
30
|
|
|
13
|
|
|
|
|
67
|
|
5
|
13
|
|
|
13
|
|
707
|
use strict; |
|
13
|
|
|
|
|
40
|
|
|
13
|
|
|
|
|
402
|
|
6
|
13
|
|
|
13
|
|
69
|
use warnings; |
|
13
|
|
|
|
|
31
|
|
|
13
|
|
|
|
|
2130
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub new { |
9
|
|
|
|
|
|
|
# uncoverable pod |
10
|
390
|
|
|
390
|
0
|
1434
|
my ( $class, %args ) = @_; |
11
|
|
|
|
|
|
|
# caller should be an arrayref tuple [file, line] |
12
|
|
|
|
|
|
|
### assert: defined $args{invocant} |
13
|
|
|
|
|
|
|
### assert: defined $args{caller} |
14
|
|
|
|
|
|
|
### assert: ref $args{caller} eq 'ARRAY' && @{$args{caller}} == 2 |
15
|
390
|
|
|
|
|
1624
|
return $class->SUPER::new(%args); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub invocant { |
19
|
|
|
|
|
|
|
# uncoverable pod |
20
|
193
|
|
|
193
|
0
|
656
|
return $_[0]->{invocant}; |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub caller { ## no critic (ProhibitBuiltinHomonyms) |
24
|
|
|
|
|
|
|
# uncoverable pod |
25
|
78
|
|
|
78
|
0
|
10467
|
return @{ $_[0]->{caller} }; # ($file, $line) |
|
78
|
|
|
|
|
558
|
|
26
|
|
|
|
|
|
|
} |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub stringify_long { |
29
|
|
|
|
|
|
|
# uncoverable pod |
30
|
78
|
|
|
78
|
0
|
2355
|
my ($self) = @_; |
31
|
78
|
|
|
|
|
210
|
return sprintf '%s called at %s line %d', |
32
|
|
|
|
|
|
|
$self->SUPER::stringify, $self->caller; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |