examples/digest/features/step_definitions/basic_steps.pl

filter: Statementstmt 100% 70 / 70 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 20 / 20 Podpod n/a totaltotal 100% 90 / 90 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/Test/BDD/Cucumber/Model/Step.pm ↑ Summary examples/i18n_es/features/step_definitions/basic_steps.pl »
1 #!perl
2  
3 6 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 6 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 6 ▶use Digest;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 6 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 6 ▶use Test::BDD::Cucumber::StepFile;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 6 ▶Given qr/a usable "(\w+)" class/, sub { use_ok( C->matches->[0] ); };
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine __ANON__: called CC=1 SCAR=0.0
12  
13 35 ▶Given qr/a Digest (\S+) object/, sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
14 35 my $object = Digest->new( C->matches->[0] );
15 35 ok( $object, "Object created" );
16 35 S->{'object'} = $object;
17 6 };
18  
19 31 ▶When qr/I've added "(.+)" to the object/, sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
20 31 S->{'object'}->add( C->matches->[0] );
21 6 };
22  
23 7 ▶When "I've added the following to the object", sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
24 7 S->{'object'}->add( C->data );
25 6 };
26  
27 38 ▶Then qr/the (.+) output is "(.+)"/, sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
28 38 my ( $type, $expected ) = @{ C->matches };
29 my $method = {
30 'base64' => 'b64digest',
31 'hex' => 'hexdigest'
32 38 }->{$type};
33  
34 38 is( S->{'object'}->$method, $expected );
35 6 };
« blib/lib/Test/BDD/Cucumber/Model/Step.pm ↑ Summary examples/i18n_es/features/step_definitions/basic_steps.pl »