This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
9ac6baf72ceaa1560db98553664ee5e039711b31
[perl5.git] / cpan / Test-Simple / t / Test2 / modules / Event / Encoding.t
1 use strict;
2 use warnings;
3
4 use Test2::Tools::Tiny;
5
6 use ok 'Test2::Event::Encoding';
7 my $CLASS = 'Test2::Event::Encoding';
8
9 like(
10     exception { $CLASS->new() },
11     qr/'encoding' is a required attribute/,
12     "Must specify the encoding"
13 );
14
15 my $one = $CLASS->new(encoding => 'utf8');
16 is($one->encoding, 'utf8', "Got encoding");
17 is($one->summary, "Encoding set to utf8", "Got summary");
18
19 is_deeply(
20     $one->facet_data,
21     {
22         about => { package => $CLASS, details => "Encoding set to utf8" },
23         control => { encoding => 'utf8' },
24     },
25     "Got facet data"
26 );
27
28 done_testing;