File Coverage

blib/lib/Test/Reporter/Transport/File.pm
Criterion Covered Total %
statement 15 15 100.0
branch 2 4 50.0
condition 1 3 33.3
subroutine 5 5 100.0
pod 2 2 100.0
total 25 29 86.2


line stmt bran cond sub pod time code
1 2     2   10 use strict;
  2         2  
  2         177  
2 2 50   2   23 BEGIN{ if (not $] < 5.006) { require warnings; warnings->import } }
  2         14  
  2         154  
3             package Test::Reporter::Transport::File;
4              
5             our $VERSION = '1.61'; # TRIAL
6              
7 2     2   14 use base 'Test::Reporter::Transport';
  2         4  
  2         396  
8              
9             sub new {
10 1     1 1 2 my ($class, $dir) = @_;
11              
12 1 50 33     57 die "target directory '$dir' doesn't exist or can't be written to"
13             unless -d $dir && -w $dir;
14              
15 1         11 return bless { dir => $dir } => $class;
16             }
17              
18             sub send {
19 1     1 1 3 my ($self, $report) = @_;
20 1         28 $report->dir( $self->{dir} );
21 1         5 return $report->write();
22             }
23              
24             1;
25              
26             # ABSTRACT: File transport for Test::Reporter
27              
28             __END__