File Coverage

blib/lib/Test/Proto/Series.pm
Criterion Covered Total %
statement 11 11 100.0
branch n/a
condition n/a
subroutine 4 4 100.0
pod 0 1 0.0
total 15 16 93.7


line stmt bran cond sub pod time code
1             package Test::Proto::Series;
2 5     5   4219 use strict;
  5         14  
  5         184  
3 5     5   27 use warnings;
  5         11  
  5         139  
4 5     5   26 use Moo;
  5         12  
  5         34  
5              
6             has 'contents',
7             is => 'rw',
8             default => sub { [] };
9              
10             sub BUILDARGS {
11 48     48 0 3159 my $class = shift;
12 48         1286 return { contents => [@_] };
13             }
14              
15             around 'contents' => \&Test::Proto::Common::chainable;
16              
17             =head1 NAME
18              
19             Test::Proto::Series - represent a series in array validation
20              
21             =head1 SYNOPSIS
22              
23             pArray->contains_only(pSeries('a', 'b', 'c'));
24             # will validate ['a', 'b', 'c'] as true
25              
26             Used in array validation to represent a sequence which must be present in its entirety. Only really useful when used in combination with L and L, which can be nested inside a series, or can contain a series.
27              
28             =head1 METHODS
29              
30             =head3 new
31              
32             Each argument is another element in the series.
33              
34             =head3 contents
35              
36             die unless exists $alternation->contents->[0];
37              
38             A chainable getter/setter method for the contents of the series.
39              
40             =cut
41              
42             1;