File Coverage

blib/lib/Test/Class/Moose/Report/Instance.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::Instance;
2              
3             # ABSTRACT: Reporting on test classes
4              
5 30     30   250 use strict;
  30         72  
  30         1076  
6 30     30   180 use warnings;
  30         66  
  30         971  
7 30     30   287 use namespace::autoclean;
  30         90  
  30         346  
8              
9 30     30   3476 use 5.010000;
  30         119  
10              
11             our $VERSION = '0.99';
12              
13 30     30   223 use Moose;
  30         67  
  30         264  
14 30     30   157681 use Carp;
  30         85  
  30         8237  
15              
16             with qw(
17             Test::Class::Moose::Role::Reporting
18             );
19              
20             has test_startup_method => (
21             is => 'rw',
22             isa => 'Test::Class::Moose::Report::Method',
23             writer => 'set_test_startup_method',
24             );
25              
26             has test_shutdown_method => (
27             is => 'rw',
28             isa => 'Test::Class::Moose::Report::Method',
29             writer => 'set_test_shutdown_method',
30             );
31              
32             has test_methods => (
33             is => 'ro',
34             traits => ['Array'],
35             isa => 'ArrayRef[Test::Class::Moose::Report::Method]',
36             default => sub { [] },
37             handles => {
38             all_test_methods => 'elements',
39             add_test_method => 'push',
40             num_test_methods => 'count',
41             },
42             );
43              
44             sub current_method {
45 87     87 1 211 my $self = shift;
46 87         3040 return $self->test_methods->[-1];
47             }
48              
49             __PACKAGE__->meta->make_immutable;
50              
51             1;
52              
53             __END__
54              
55             =pod
56              
57             =encoding UTF-8
58              
59             =head1 NAME
60              
61             Test::Class::Moose::Report::Instance - Reporting on test classes
62              
63             =head1 VERSION
64              
65             version 0.99
66              
67             =head1 DESCRIPTION
68              
69             Should be considered experimental and B<read only>.
70              
71             =head1 IMPLEMENTS
72              
73             L<Test::Class::Moose::Role::Reporting>.
74              
75             =head1 ATTRIBUTES
76              
77             See L<Test::Class::Moose::Role::Reporting> for additional attributes.
78              
79             =head2 C<class>
80              
81             The L<Test::Class::Moose::Report::Class> for this instance.
82              
83             =head2 C<all_test_methods>
84              
85             Returns an array of L<Test::Class::Moose::Report::Method> objects.
86              
87             =head2 C<current_method>
88              
89             Returns the current (really, most recent) L<Test::Class::Moose::Report::Method>
90             object that is being run.
91              
92             =head1 SUPPORT
93              
94             Bugs may be submitted at L<https://github.com/houseabsolute/test-class-moose/issues>.
95              
96             I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>.
97              
98             =head1 SOURCE
99              
100             The source code repository for Test-Class-Moose can be found at L<https://github.com/houseabsolute/test-class-moose>.
101              
102             =head1 AUTHORS
103              
104             =over 4
105              
106             =item *
107              
108             Curtis "Ovid" Poe <ovid@cpan.org>
109              
110             =item *
111              
112             Dave Rolsky <autarch@urth.org>
113              
114             =back
115              
116             =head1 COPYRIGHT AND LICENSE
117              
118             This software is copyright (c) 2012 - 2021 by Curtis "Ovid" Poe.
119              
120             This is free software; you can redistribute it and/or modify it under
121             the same terms as the Perl 5 programming language system itself.
122              
123             The full text of the license can be found in the
124             F<LICENSE> file included with this distribution.
125              
126             =cut