This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade Test::Simple from version 1.302049 to 1.302052
[perl5.git] / cpan / Test-Simple / lib / Test2 / Event / Subtest.pm
1 package Test2::Event::Subtest;
2 use strict;
3 use warnings;
4
5 our $VERSION = '1.302052';
6
7
8 BEGIN { require Test2::Event::Ok; our @ISA = qw(Test2::Event::Ok) }
9 use Test2::Util::HashBase qw{subevents buffered subtest_id};
10
11 sub init {
12     my $self = shift;
13     $self->SUPER::init();
14     $self->{+SUBEVENTS} ||= [];
15 }
16
17 sub summary {
18     my $self = shift;
19
20     my $name = $self->{+NAME} || "Nameless Subtest";
21
22     my $todo = $self->{+TODO};
23     if ($todo) {
24         $name .= " (TODO: $todo)";
25     }
26     elsif (defined $todo) {
27         $name .= " (TODO)"
28     }
29
30     return $name;
31 }
32
33 1;
34
35 __END__
36
37 =pod
38
39 =encoding UTF-8
40
41 =head1 NAME
42
43 Test2::Event::Subtest - Event for subtest types
44
45 =head1 DESCRIPTION
46
47 This class represents a subtest. This class is a subclass of
48 L<Test2::Event::Ok>.
49
50 =head1 ACCESSORS
51
52 This class inherits from L<Test2::Event::Ok>.
53
54 =over 4
55
56 =item $arrayref = $e->subevents
57
58 Returns the arrayref containing all the events from the subtest
59
60 =item $bool = $e->buffered
61
62 True if the subtest is buffered, that is all subevents render at once. If this
63 is false it means all subevents render as they are produced.
64
65 =back
66
67 =head1 SOURCE
68
69 The source code repository for Test2 can be found at
70 F<http://github.com/Test-More/test-more/>.
71
72 =head1 MAINTAINERS
73
74 =over 4
75
76 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
77
78 =back
79
80 =head1 AUTHORS
81
82 =over 4
83
84 =item Chad Granum E<lt>exodist@cpan.orgE<gt>
85
86 =back
87
88 =head1 COPYRIGHT
89
90 Copyright 2016 Chad Granum E<lt>exodist@cpan.orgE<gt>.
91
92 This program is free software; you can redistribute it and/or
93 modify it under the same terms as Perl itself.
94
95 See F<http://dev.perl.org/licenses/>
96
97 =cut