Test-BDD-Cucumber

 view release on metacpan or  search on metacpan

t/lib/Test/CucumberExtensionMetadataVerify.pm  view on Meta::CPAN

13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
 
sub pre_step  {
    my ($self, $step, $step_context) = @_;
 
    croak 'pre_step called with incorrect number $step array elements'
        if scalar(@$step) != 3;
 
    croak 'pre_step called with incorrect first element type of $step array'
        # 5.10 reports SCALAR where the argument actually is a regexp; ignore <=5.10
        if reftype $step->[0] ne 'REGEXP' and $] ge '5.012';
 
    croak 'pre_step called with incorrect second element type of $step array'
        if reftype $step->[1] ne 'HASH';
 
    croak 'pre_step called with incorrect meta data content in $step array'
        if exists $step->[1]->{meta} and $step->[1]->{meta} ne 'data';
 
    croak 'pre_step called with incorrect third element type of $step array'
        if reftype $step->[2] ne 'CODE';
}



( run in 0.227 second using v1.01-cache-2.11-cpan-94b05bcf43c )