File Coverage

blib/lib/OpenID/Lite/RelyingParty/Discover/Method/Base.pm
Criterion Covered Total %
statement 10 12 83.3
branch 3 4 75.0
condition n/a
subroutine 3 5 60.0
pod 0 1 0.0
total 16 22 72.7


line stmt bran cond sub pod time code
1             package OpenID::Lite::RelyingParty::Discover::Method::Base;
2              
3 2     2   752 use Any::Moose;
  2         5  
  2         15  
4             with 'OpenID::Lite::Role::Discoverer';
5             with 'OpenID::Lite::Role::ErrorHandler';
6             with 'OpenID::Lite::Role::AgentHandler';
7              
8             has '_fetcher' => (
9             is => 'ro',
10             lazy_build => 1,
11             );
12              
13             has '_parser' => (
14             is => 'ro',
15             lazy_build => 1,
16             );
17              
18             sub discover {
19 10     10 0 16 my ( $self, $identifier ) = @_;
20 10 50       63 my $result = $self->_fetcher->fetch( $identifier->as_string )
21             or return $self->ERROR( $self->_fetcher->errstr );
22 10 100       423 my $services = $self->_parser->parse( $result )
23             or return $self->ERROR( $self->_parser->errstr );
24 8         71 return $services;
25             }
26              
27             sub _build__fetcher {
28 0     0     die "Abstract Method";
29             }
30              
31              
32             sub _build__parser {
33 0     0     die "Abstract Method";
34             }
35              
36 2     2   1680 no Any::Moose;
  2         6  
  2         10  
37             __PACKAGE__->meta->make_immutable;
38             1;
39              
40