File Coverage

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