1 package Test2::Event::Encoding;
5 our $VERSION = '1.302133';
9 BEGIN { require Test2::Event; our @ISA = qw(Test2::Event) }
10 use Test2::Util::HashBase qw/encoding/;
14 defined $self->{+ENCODING} or croak "'encoding' is a required attribute";
17 sub summary { 'Encoding set to ' . $_[0]->{+ENCODING} }
21 my $out = $self->common_facet_data;
22 $out->{control}->{encoding} = $self->{+ENCODING};
23 $out->{about}->{details} = $self->summary;
38 Test2::Event::Encoding - Set the encoding for the output stream
42 The encoding event is generated when a test file wants to specify the encoding
43 to be used when formatting its output. This event is intended to be produced
44 by formatter classes and used for interpreting test names, message contents,
49 use Test2::API qw/context/;
50 use Test2::Event::Encoding;
53 my $event = $ctx->send_event('Encoding', encoding => 'UTF-8');
57 Inherits from L<Test2::Event>. Also defines:
61 =item $encoding = $e->encoding
63 The encoding being specified.
69 The source code repository for Test2 can be found at
70 F<http://github.com/Test-More/test-more/>.
76 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
84 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
90 Copyright 2018 Chad Granum E<lt>exodist@cpan.orgE<gt>.
92 This program is free software; you can redistribute it and/or
93 modify it under the same terms as Perl itself.
95 See F<http://dev.perl.org/licenses/>