File Coverage

blib/lib/Test/Class/Moose/Report/Class.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 1 100.0
total 19 19 100.0


line stmt bran cond sub pod time code
1             package Test::Class::Moose::Report::Class;
2              
3             # ABSTRACT: Reporting on test classes
4              
5 29     29   546 use 5.010000;
  29         95  
6              
7             our $VERSION = '0.97';
8              
9 29     29   155 use Moose;
  29         97  
  29         497  
10 29     29   183549 use Carp;
  29         136  
  29         1848  
11 29     29   184 use namespace::autoclean;
  29         58  
  29         270  
12              
13             with qw(
14             Test::Class::Moose::Role::Reporting
15             );
16              
17             has test_instances => (
18             is => 'ro',
19             traits => ['Array'],
20             isa => 'ArrayRef[Test::Class::Moose::Report::Instance]',
21             default => sub { [] },
22             handles => {
23             all_test_instances => 'elements',
24             add_test_instance => 'push',
25             num_test_instances => 'count',
26             },
27             );
28              
29             sub current_instance {
30 153     153 1 236 my $self = shift;
31 153         4063 return $self->test_instances->[-1];
32             }
33              
34             __PACKAGE__->meta->make_immutable;
35              
36             1;
37              
38             __END__
39              
40             =pod
41              
42             =encoding UTF-8
43              
44             =head1 NAME
45              
46             Test::Class::Moose::Report::Class - Reporting on test classes
47              
48             =head1 VERSION
49              
50             version 0.97
51              
52             =head1 DESCRIPTION
53              
54             Should be considered experimental and B<read only>.
55              
56             =head1 IMPLEMENTS
57              
58             L<Test::Class::Moose::Role::Reporting>.
59              
60             =head1 ATTRIBUTES
61              
62             See L<Test::Class::Moose::Role::Reporting> for additional attributes.
63              
64             =head2 C<all_test_instances>
65              
66             Returns an array of L<Test::Class::Moose::Report::Instance> objects.
67              
68             =head2 C<current_instance>
69              
70             Returns the current (really, most recent)
71             L<Test::Class::Moose::Report::Instance> object that is being run.
72              
73             =head1 SUPPORT
74              
75             Bugs may be submitted at L<https://github.com/houseabsolute/test-class-moose/issues>.
76              
77             I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>.
78              
79             =head1 SOURCE
80              
81             The source code repository for Test-Class-Moose can be found at L<https://github.com/houseabsolute/test-class-moose>.
82              
83             =head1 AUTHORS
84              
85             =over 4
86              
87             =item *
88              
89             Curtis "Ovid" Poe <ovid@cpan.org>
90              
91             =item *
92              
93             Dave Rolsky <autarch@urth.org>
94              
95             =back
96              
97             =head1 COPYRIGHT AND LICENSE
98              
99             This software is copyright (c) 2012 - 2019 by Curtis "Ovid" Poe.
100              
101             This is free software; you can redistribute it and/or modify it under
102             the same terms as the Perl 5 programming language system itself.
103              
104             The full text of the license can be found in the
105             F<LICENSE> file included with this distribution.
106              
107             =cut