File Coverage

blib/lib/Mojo/ACME/CA.pm
Criterion Covered Total %
statement 14 14 100.0
branch 4 8 50.0
condition 1 3 33.3
subroutine 4 4 100.0
pod 0 1 0.0
total 23 30 76.6


line stmt bran cond sub pod time code
1             package Mojo::ACME::CA;
2              
3 1     1   368 use Mojo::Base -base;
  1         2  
  1         6  
4              
5 1     1   121 use Mojo::URL;
  1         1  
  1         4  
6 1     1   20 use Scalar::Util ();
  1         1  
  1         180  
7              
8             has agreement => 'https://letsencrypt.org/documents/LE-SA-v1.0.1-July-27-2015.pdf';
9             has intermediate => sub { die 'intermediate cert not defined' };
10             has name => 'Unknown CA';
11             has test_mode => 0;
12              
13             has [qw/primary_url test_url/] => '';
14              
15             sub url {
16 7     7 0 47 my ($self, $path) = @_;
17 7 50       20 die 'URL not defined'
    50          
18             unless my $url = $self->test_mode ? $self->test_url : $self->primary_url;
19              
20 7 50 33     132 $url =
21             Scalar::Util::blessed($url) && $url->isa('Mojo::URL')
22             ? $url->clone
23             : Mojo::URL->new("$url");
24              
25 7 50       430 $url->path($path) if $path;
26 7         122 return $url;
27             }
28              
29             1;
30