File Coverage

blib/lib/Test2/Event/Warning.pm
Criterion Covered Total %
statement 16 17 94.1
branch 2 4 50.0
condition n/a
subroutine 7 8 87.5
pod 3 4 75.0
total 28 33 84.8


line stmt bran cond sub pod time code
1             package Test2::Event::Warning;
2              
3 2     2   12 use strict;
  2         3  
  2         46  
4 2     2   8 use warnings;
  2         4  
  2         63  
5              
6             our $VERSION = '0.08';
7              
8 2     2   726 use parent 'Test2::Event';
  2         4428  
  2         10  
9              
10 2     2   121 use Test2::Util::HashBase qw( causes_fail warning );
  2         3  
  2         24  
11              
12             sub init {
13 2 50   2 0 134 $_[0]->{ +CAUSES_FAIL } = 1 unless exists $_[0]->{ +CAUSES_FAIL };
14 2 50       9 $_[0]->{ +WARNING } = 'undef' unless defined $_[0]->{ +WARNING };
15             }
16              
17 12     12 1 1140 sub summary { $_[0]->{ +WARNING } }
18              
19 8     8 1 6175 sub increments_count {1}
20 0     0 1   sub diagnostics {1}
21              
22             1;
23              
24             # ABSTRACT: A Test2 event for warnings
25              
26             __END__
27              
28             =pod
29              
30             =encoding UTF-8
31              
32             =head1 NAME
33              
34             Test2::Event::Warning - A Test2 event for warnings
35              
36             =head1 VERSION
37              
38             version 0.08
39              
40             =head1 DESCRIPTION
41              
42             An event representing an unwanted warning. This is treated as a failure.
43              
44             =for Pod::Coverage init
45              
46             =head1 ACCESSORS
47              
48             =over 4
49              
50             =item $warning = $event->warning
51              
52             Returns the warning that this event captured.
53              
54             =back
55              
56             =head1 SUPPORT
57              
58             Bugs may be submitted at L<https://github.com/houseabsolute/Test2-Plugin-NoWarnings/issues>.
59              
60             I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>.
61              
62             =head1 SOURCE
63              
64             The source code repository for Test2-Plugin-NoWarnings can be found at L<https://github.com/houseabsolute/Test2-Plugin-NoWarnings>.
65              
66             =head1 AUTHOR
67              
68             Dave Rolsky <autarch@urth.org>
69              
70             =head1 COPYRIGHT AND LICENSE
71              
72             This software is Copyright (c) 2019 by Dave Rolsky.
73              
74             This is free software, licensed under:
75              
76             The Artistic License 2.0 (GPL Compatible)
77              
78             The full text of the license can be found in the
79             F<LICENSE> file included with this distribution.
80              
81             =cut