TrueLayer/Types.pm

filter: Statementstmt 100% 20 / 20 Branchbran 83.3% 5 / 6 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 8 / 8 Podpod n/a totaltotal 97.0% 33 / 34 CC 4 SCAR 4.5
CC
4
Cov
96%
__ANON__
2.1
__ANON__
2.0
__ANON__
2.0
CRAP 1.6
« TrueLayer/Webhook.pm ↑ Summary TrueLayer.pm »
1 package Business::TrueLayer::Types;
2  
3 9 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 9 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 9 ▶use Moose::Util::TypeConstraints;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 # objects can be Test::MockObject(s) so we can do "end to end"
9 # testing without actually going out on the wire
10 subtype 'UserAgent'
11 => as 'Object'
12 36 ▶ => where {
Subroutine __ANON__: called CC=2 SCAR=6.9
13 36 ▶ $_->isa( 'Mojo::UserAgent' )
Branch: 1 branch
BranchTrueFalseTotal
$_->isa("Mojo::UserAgent") or $_->isa("Test::MockObject") 20 16 36
14 or $_->isa( 'Test::MockObject' )
15 }
16 9 ;
17  
18 subtype 'Authenticator'
19 => as 'Object'
20 2 ▶ => where {
Subroutine __ANON__: called CC=2 SCAR=6.9
21 2 ▶ $_->isa( 'Business::TrueLayer::Authenticator' )
Branch: 1 branch
BranchTrueFalseTotal
$_->isa("Business::TrueLayer::Authenticator") or $_->isa("Test::MockObject") 1 1 2
22 or $_->isa( 'Test::MockObject' )
23 }
24 9 ;
25  
26 subtype 'Signer'
27 => as 'Object'
28 1 ▶ => where {
Subroutine __ANON__: called CC=2 SCAR=7.6
29 1 ▶ $_->isa( 'Business::TrueLayer::Signer' )
Branch: 1 branch
BranchTrueFalseTotal
$_->isa("Business::TrueLayer::Signer") or $_->isa("Test::MockObject") 0 1 1
30 or $_->isa( 'Test::MockObject' )
31 }
32 9 ;
33  
34 subtype 'EC512:PrivateKey'
35 => as 'Object'
36 1 ▶ => where {
Subroutine __ANON__: called CC=1 SCAR=0.0
37 1 $_->isa( 'Crypt::PK::ECC' )
38 }
39 9 ;
40  
41 coerce 'EC512:PrivateKey'
42 => from 'Value'
43 1 ▶ => via {
Subroutine __ANON__: called CC=1 SCAR=0.0
44 1 Crypt::PK::ECC->new( $_ )
45 }
46 9 ;
47  
48 9 1;
49  
50 # vim: ts=4:sw=4:et
« TrueLayer/Webhook.pm ↑ Summary TrueLayer.pm »