File Coverage

tfiles/service/multi-impl
Criterion Covered Total %
statement 13 25 52.0
branch 0 2 0.0
condition 0 3 0.0
subroutine 5 12 41.6
pod n/a
total 18 42 42.8


line stmt bran cond sub pod time code
1             # vim:ft=perl
2 1     1   8 use strict;
  1         1  
  1         27  
3 1     1   3 use warnings;
  1         1  
  1         26  
4              
5 1     1   3 use parent qw(Ubic::Multiservice);
  1         2  
  1         6  
6 1     1   64 use Ubic::Service::Common;
  1         2  
  1         225  
7              
8             sub new {
9 1     1   8 return bless {} => shift;
10             }
11              
12             my $eval_id = 1;
13             sub simple_service {
14 0     0     my ($self, $name) = @_;
15 0 0 0       if ($name eq 'abc' or $name eq 'def') {
16             return Ubic::Service::Common->new({
17 0     0     start => sub { die },
18 0     0     stop => sub { die },
19 0     0     status => sub { die },
20 0           });
21             }
22             }
23              
24             sub has_simple_service {
25 0     0     my ($self, $name) = @_;
26 0           return (grep { $name eq $_ } $self->service_names);
  0            
27             }
28              
29             sub service_names {
30 0     0     my ($self) = @_;
31 0           return qw/ abc def /;
32             }
33              
34             sub multiop {
35 0     0     return 'protected';
36             }
37              
38             __PACKAGE__->new;