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   258 use strict;
  30         100  
  30         1381  
6 30     30   187 use warnings;
  30         99  
  30         3108  
7 30     30   284 use namespace::autoclean;
  30         78  
  30         334  
8              
9 30     30   3392 use 5.010000;
  30         142  
10              
11             our $VERSION = '1.00';
12              
13 30     30   191 use Moose;
  30         90  
  30         267  
14 30     30   188125 use Carp;
  30         77  
  30         8499  
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 261 my $self = shift;
46 87         4505 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 1.00
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/Test-More/test-class-moose/issues>.
95              
96             =head1 SOURCE
97              
98             The source code repository for Test-Class-Moose can be found at L<https://github.com/Test-More/test-class-moose>.
99              
100             =head1 AUTHORS
101              
102             =over 4
103              
104             =item *
105              
106             Curtis "Ovid" Poe <ovid@cpan.org>
107              
108             =item *
109              
110             Dave Rolsky <autarch@urth.org>
111              
112             =item *
113              
114             Chad Granum <exodist@cpan.org>
115              
116             =back
117              
118             =head1 COPYRIGHT AND LICENSE
119              
120             This software is copyright (c) 2012 - 2025 by Curtis "Ovid" Poe.
121              
122             This is free software; you can redistribute it and/or modify it under
123             the same terms as the Perl 5 programming language system itself.
124              
125             The full text of the license can be found in the
126             F<LICENSE> file included with this distribution.
127              
128             =cut