File Coverage

tfiles/service/fake-http-service
Criterion Covered Total %
statement 12 12 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod n/a
total 16 16 100.0


line stmt bran cond sub pod time code
1             # vim: ft=perl
2              
3 2     2   19 use strict;
  2         2  
  2         66  
4 2     2   9 use warnings;
  2         2  
  2         85  
5              
6 2     2   295 use Ubic::Service::Common;
  2         3  
  2         53  
7 2     2   8 use Storable;
  2         2  
  2         283  
8              
9             my $file = 'tfiles/fake-http-service.status';
10             return Ubic::Service::Common->new({
11             start => sub {
12             store { status => 'running' } => $file;
13             },
14             stop => sub {
15             store { status => 'not running' } => $file;
16             },
17             status => sub {
18             return unless -e $file;
19             return retrieve($file)->{status};
20             },
21             port => 12347,
22             });