File Coverage

blib/lib/Log/Log4perl/Appender/TAP.pm
Criterion Covered Total %
statement 22 22 100.0
branch n/a
condition 3 5 60.0
subroutine 6 6 100.0
pod 1 2 50.0
total 32 35 91.4


line stmt bran cond sub pod time code
1             package Log::Log4perl::Appender::TAP;
2              
3 2     2   3812 use strict;
  2         2  
  2         46  
4 2     2   6 use warnings;
  2         2  
  2         36  
5 2     2   27 use 5.008001;
  2         4  
6 2     2   5 use Test2::API qw( context );
  2         2  
  2         311  
7             our @ISA = qw( Log::Log4perl::Appender );
8              
9             # ABSTRACT: Append to TAP output
10             our $VERSION = '0.03'; # VERSION
11              
12              
13             sub new
14             {
15 3     3 1 1431 my $proto = shift;
16 3   33     14 my $class = ref $proto || $proto;
17 3         10 my %args = @_;
18             bless {
19 3   100     20 method => $args{method} || 'note',
20             }, $class;
21             }
22              
23             sub log
24             {
25 2     2 0 5567 my $self = shift;
26 2         5 my %args = @_;
27 2         5 my $method = $self->{method};
28 2         4 my $ctx = context();
29 2         103 $ctx->$method($args{message});
30 2         118 $ctx->release;
31 2         33 return;
32             }
33              
34             1;
35              
36             __END__