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   79250 use strict;
  13         45  
  13         471  
6 13     13   66 use warnings;
  13         14  
  13         1190  
7 13     13   119 use namespace::autoclean;
  13         36  
  13         118  
8              
9 13     13   1321 use 5.010000;
  13         52  
10              
11             our $VERSION = '1.00';
12              
13 13     13   6108 use Moose::Role;
  13         64295  
  13         55  
14              
15             requires '_constructor_parameter_sets';
16              
17             ## no critic (Subroutines::ProhibitUnusedPrivateSubroutines)
18             sub _tcm_make_test_class_instances {
19 6     6   51 my $class = shift;
20 6         64 my %base_args = @_;
21              
22 6         124 my %sets = $class->_constructor_parameter_sets;
23              
24 6         103 my @instances;
25 6         41 for my $name ( keys %sets ) {
26 8         26 my $instance = $class->new( %{ $sets{$name} }, %base_args );
  8         487  
27 8         11353 $instance->_set_test_instance_name($name);
28 8         31 push @instances, $instance;
29             }
30              
31 6         94 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 1.00
49              
50             =head1 SUPPORT
51              
52             Bugs may be submitted at L<https://github.com/Test-More/test-class-moose/issues>.
53              
54             =head1 SOURCE
55              
56             The source code repository for Test-Class-Moose can be found at L<https://github.com/Test-More/test-class-moose>.
57              
58             =head1 AUTHORS
59              
60             =over 4
61              
62             =item *
63              
64             Curtis "Ovid" Poe <ovid@cpan.org>
65              
66             =item *
67              
68             Dave Rolsky <autarch@urth.org>
69              
70             =item *
71              
72             Chad Granum <exodist@cpan.org>
73              
74             =back
75              
76             =head1 COPYRIGHT AND LICENSE
77              
78             This software is copyright (c) 2012 - 2025 by Curtis "Ovid" Poe.
79              
80             This is free software; you can redistribute it and/or modify it under
81             the same terms as the Perl 5 programming language system itself.
82              
83             The full text of the license can be found in the
84             F<LICENSE> file included with this distribution.
85              
86             =cut