File Coverage

blib/lib/Test/Class/Moose/Role/ParameterizedInstances.pm
Criterion Covered Total %
statement 24 24 100.0
branch n/a
condition n/a
subroutine 6 6 100.0
pod n/a
total 30 30 100.0


line stmt bran cond sub pod time code
1             package Test::Class::Moose::Role::ParameterizedInstances;
2              
3             # ABSTRACT: run tests against multiple instances of a test class
4              
5 13     13   77671 use strict;
  13         50  
  13         498  
6 13     13   89 use warnings;
  13         26  
  13         487  
7 13     13   79 use namespace::autoclean;
  13         27  
  13         168  
8              
9 13     13   1446 use 5.010000;
  13         53  
10              
11             our $VERSION = '0.99';
12              
13 13     13   7103 use Moose::Role;
  13         71512  
  13         66  
14              
15             requires '_constructor_parameter_sets';
16              
17             ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
18             sub _tcm_make_test_class_instances {
19 6     6   60 my $class = shift;
20 6         99 my %base_args = @_;
21              
22 6         147 my %sets = $class->_constructor_parameter_sets;
23              
24 6         129 my @instances;
25 6         65 for my $name ( keys %sets ) {
26 8         20 my $instance = $class->new( %{ $sets{$name} }, %base_args );
  8         439  
27 8         8277 $instance->_set_test_instance_name($name);
28 8         28 push @instances, $instance;
29             }
30              
31 6         42 return @instances;
32             }
33              
34             1;
35              
36             __END__
37              
38             =pod
39              
40             =encoding UTF-8
41              
42             =head1 NAME
43              
44             Test::Class::Moose::Role::ParameterizedInstances - run tests against multiple instances of a test class
45              
46             =head1 VERSION
47              
48             version 0.99
49              
50             =head1 SUPPORT
51              
52             Bugs may be submitted at L<https://github.com/houseabsolute/test-class-moose/issues>.
53              
54             I am also usually active on IRC as 'autarch' on C<irc://irc.perl.org>.
55              
56             =head1 SOURCE
57              
58             The source code repository for Test-Class-Moose can be found at L<https://github.com/houseabsolute/test-class-moose>.
59              
60             =head1 AUTHORS
61              
62             =over 4
63              
64             =item *
65              
66             Curtis "Ovid" Poe <ovid@cpan.org>
67              
68             =item *
69              
70             Dave Rolsky <autarch@urth.org>
71              
72             =back
73              
74             =head1 COPYRIGHT AND LICENSE
75              
76             This software is copyright (c) 2012 - 2021 by Curtis "Ovid" Poe.
77              
78             This is free software; you can redistribute it and/or modify it under
79             the same terms as the Perl 5 programming language system itself.
80              
81             The full text of the license can be found in the
82             F<LICENSE> file included with this distribution.
83              
84             =cut