1use strict;
2use warnings;
3
4use Test2::Tools::Tiny;
5use Test2::API qw/intercept context/;
6
7use ok 'Test2::Event::Fail';
8my $CLASS = 'Test2::Event::Fail';
9
10my $one = $CLASS->new(name => 'no soup for you');
11
12is($one->summary,          "fail", 'summary');
13is($one->increments_count, 1,      'increments_count');
14is($one->diagnostics,      0,      'diagnostics');
15is($one->no_display,       0,      'no_display');
16is($one->subtest_id,       undef,  'subtest_id');
17is($one->terminate,        undef,  'terminate');
18is($one->global,           undef,  'global');
19is($one->sets_plan,        undef,  'sets_plan');
20is($one->causes_fail,      1,      'causes_fail');
21
22$one->add_amnesty({tag => 'blah', details => 'blah'});
23is($one->causes_fail,      0,      'causes_fail is off with amnesty');
24
25$one->add_info({tag => 'xxx', details => 'yyy'});
26
27is_deeply(
28    $one->facet_data,
29    {
30        about   => {package => $CLASS, details => 'fail', eid => $one->eid},
31        assert  => {pass    => 0,      details => 'no soup for you'},
32        amnesty => [{tag    => 'blah', details => 'blah'}],
33        info    => [{tag    => 'xxx',  details => 'yyy'}],
34    },
35    "Got facet data"
36);
37
38done_testing;
39