1package Test2::Event::TAP::Version;
2use strict;
3use warnings;
4
5our $VERSION = '1.302175';
6
7use Carp qw/croak/;
8
9BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
10use Test2::Util::HashBase qw/version/;
11
12sub init {
13    my $self = shift;
14    defined $self->{+VERSION} or croak "'version' is a required attribute";
15}
16
17sub summary { 'TAP version ' . $_[0]->{+VERSION} }
18
19sub facet_data {
20    my $self = shift;
21
22    my $out = $self->common_facet_data;
23
24    $out->{about}->{details} = $self->summary;
25
26    push @{$out->{info}} => {
27        tag     => 'INFO',
28        debug   => 0,
29        details => $self->summary,
30    };
31
32    return $out;
33}
34
351;
36
37__END__
38
39=pod
40
41=encoding UTF-8
42
43=head1 NAME
44
45Test2::Event::TAP::Version - Event for TAP version.
46
47=head1 DESCRIPTION
48
49This 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
61Inherits from L<Test2::Event>. Also defines:
62
63=over 4
64
65=item $version = $e->version
66
67The TAP version being parsed.
68
69=back
70
71=head1 SOURCE
72
73The source code repository for Test2 can be found at
74F<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
94Copyright 2019 Chad Granum E<lt>exodist@cpan.orgE<gt>.
95
96This program is free software; you can redistribute it and/or
97modify it under the same terms as Perl itself.
98
99See F<http://dev.perl.org/licenses/>
100
101=cut
102