File Coverage

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