File Coverage

blib/lib/Test/Mockify/MethodSpy.pm
Criterion Covered Total %
statement 23 23 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 28 29 96.5


line stmt bran cond sub pod time code
1             package Test::Mockify::MethodSpy;
2              
3 18     18   63100 use parent 'Test::Mockify::Method';
  18         294  
  18         167  
4 18     18   1283 use strict;
  18         48  
  18         422  
5 18     18   98 use warnings;
  18         52  
  18         3254  
6              
7             #---------------------------------------------------------------------
8             sub new {
9 27     27 0 1296 my $class = shift;
10 27         51 my ($OriginalMethodPointer) = @_;
11 27         103 my $self = $class->SUPER::new();
12 27         53 $self->{'OriginalMethodPointer'} = $OriginalMethodPointer;
13 27         69 return $self;
14             }
15             #---------------------------------------------------------------------
16             sub _addToTypeStore { ## no critic (Private subroutine/method) used in chaining
17 27     27   47 my $self = shift;
18 27         44 my ($Signature, $NewExpectedParameters) = @_;
19 27         37 my $SignatureKey = join('',@{$Signature});
  27         63  
20 27         97 my $Parameter = Test::Mockify::Parameter->new($NewExpectedParameters);
21 27         67 $Parameter->buildReturn()->thenCall($self->{'OriginalMethodPointer'});
22 27         43 push(@{$self->{'TypeStore'}{$SignatureKey}}, $Parameter );
  27         60  
23 27         84 return;
24             }
25             1;