1use strict;
2use warnings;
3
4use Test2::Tools::Tiny;
5
6use ok 'Test2::Event::Encoding';
7my $CLASS = 'Test2::Event::Encoding';
8
9like(
10    exception { $CLASS->new() },
11    qr/'encoding' is a required attribute/,
12    "Must specify the encoding"
13);
14
15my $one = $CLASS->new(encoding => 'utf8');
16is($one->encoding, 'utf8', "Got encoding");
17is($one->summary, "Encoding set to utf8", "Got summary");
18
19is_deeply(
20    $one->facet_data,
21    {
22        about => {
23            package => $CLASS,
24            details => "Encoding set to utf8",
25            eid     => $one->eid,
26        },
27        control => { encoding => 'utf8' },
28    },
29    "Got facet data"
30);
31
32done_testing;
33