This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Test-Simple from version 1.302073 to 1.302096
[perl5.git] / cpan / Test-Simple / t / Test2 / modules / Event / Encoding.t
diff --git a/cpan/Test-Simple/t/Test2/modules/Event/Encoding.t b/cpan/Test-Simple/t/Test2/modules/Event/Encoding.t
new file mode 100644 (file)
index 0000000..9ac6baf
--- /dev/null
@@ -0,0 +1,28 @@
+use strict;
+use warnings;
+
+use Test2::Tools::Tiny;
+
+use ok 'Test2::Event::Encoding';
+my $CLASS = 'Test2::Event::Encoding';
+
+like(
+    exception { $CLASS->new() },
+    qr/'encoding' is a required attribute/,
+    "Must specify the encoding"
+);
+
+my $one = $CLASS->new(encoding => 'utf8');
+is($one->encoding, 'utf8', "Got encoding");
+is($one->summary, "Encoding set to utf8", "Got summary");
+
+is_deeply(
+    $one->facet_data,
+    {
+        about => { package => $CLASS, details => "Encoding set to utf8" },
+        control => { encoding => 'utf8' },
+    },
+    "Got facet data"
+);
+
+done_testing;