This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
ae87320c43712da5085be46f19fcd910a0080872
[perl5.git] / cpan / Test-Simple / lib / Test2 / Event / TAP / Version.pm
1 package Test2::Event::TAP::Version;
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.302140';
6
7 use Carp qw/croak/;
8
9 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
10 use Test2::Util::HashBase qw/version/;
11
12 sub init {
13     my $self = shift;
14     defined $self->{+VERSION} or croak "'version' is a required attribute";
15 }
16
17 sub summary { 'TAP version ' . $_[0]->{+VERSION} }
18
19 sub 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
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 2018 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