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   26 use strict;
  2         5  
  2         92  
4 2     2   13 use warnings;
  2         4  
  2         96  
5              
6 2     2   374 use Ubic::Service::Common;
  2         6  
  2         78  
7 2     2   15 use Storable;
  2         4  
  2         369  
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             });