File Coverage

blib/lib/Test2/Event/TAP/Version.pm
Criterion Covered Total %
statement 23 23 100.0
branch 2 2 100.0
condition n/a
subroutine 8 8 100.0
pod 2 3 66.6
total 35 36 97.2


line stmt bran cond sub pod time code
1             package Test2::Event::TAP::Version;
2 1     1   561 use strict;
  1         2  
  1         33  
3 1     1   6 use warnings;
  1         2  
  1         44  
4              
5             our $VERSION = '1.302181';
6              
7 1     1   6 use Carp qw/croak/;
  1         1  
  1         94  
8              
9 1     1   8 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
  1         51  
10 1     1   7 use Test2::Util::HashBase qw/version/;
  1         1  
  1         9  
11              
12             sub init {
13 2     2 0 14 my $self = shift;
14 2 100       261 defined $self->{+VERSION} or croak "'version' is a required attribute";
15             }
16              
17 3     3 1 14 sub summary { 'TAP version ' . $_[0]->{+VERSION} }
18              
19             sub facet_data {
20 1     1 1 4 my $self = shift;
21              
22 1         8 my $out = $self->common_facet_data;
23              
24 1         4 $out->{about}->{details} = $self->summary;
25              
26 1         2 push @{$out->{info}} => {
  1         4  
27             tag => 'INFO',
28             debug => 0,
29             details => $self->summary,
30             };
31              
32 1         4 return $out;
33             }
34              
35             1;
36              
37             __END__
38              
39             =pod
40              
41             =encoding UTF-8
42              
43             =head1 NAME
44              
45             Test2::Event::TAP::Version - Event for TAP version.
46              
47             =head1 DESCRIPTION
48              
49             This event is used if a TAP formatter wishes to set a version.
50              
51             =head1 SYNOPSIS
52              
53             use Test2::API qw/context/;
54             use Test2::Event::Encoding;
55              
56             my $ctx = context();
57             my $event = $ctx->send_event('TAP::Version', version => 42);
58              
59             =head1 METHODS
60              
61             Inherits from L<Test2::Event>. Also defines:
62              
63             =over 4
64              
65             =item $version = $e->version
66              
67             The TAP version being parsed.
68              
69             =back
70              
71             =head1 SOURCE
72              
73             The source code repository for Test2 can be found at
74             F<http://github.com/Test-More/test-more/>.
75              
76             =head1 MAINTAINERS
77              
78             =over 4
79              
80             =item Chad Granum E<lt>exodist@cpan.orgE<gt>
81              
82             =back
83              
84             =head1 AUTHORS
85              
86             =over 4
87              
88             =item Chad Granum E<lt>exodist@cpan.orgE<gt>
89              
90             =back
91              
92             =head1 COPYRIGHT
93              
94             Copyright 2020 Chad Granum E<lt>exodist@cpan.orgE<gt>.
95              
96             This program is free software; you can redistribute it and/or
97             modify it under the same terms as Perl itself.
98              
99             See F<http://dev.perl.org/licenses/>
100              
101             =cut