examples/i18n_es/features/step_definitions/basic_steps.pl

filter: Statementstmt 100% 50 / 50 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 15 / 15 Podpod n/a totaltotal 100% 65 / 65 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« examples/digest/features/step_definitions/basic_steps.pl ↑ Summary examples/tagged-digest/features/step_definitions/basic_steps.pl »
1 #!perl
2
3 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 ▶use Digest;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Test::More;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 2 ▶use Test::BDD::Cucumber::StepFile;
Subroutine BEGIN: called CC=1 SCAR=0.0
10
11 10 ▶Dado qr/la clase "(\w+)"/, sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
12 2 ▶ 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
13 2 };
14  
15 10 ▶Dado qr/un objeto Digest usando el algoritmo "(\S+)"/, sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
16 10 my $object = Digest->new( C->matches->[0] );
17 10 ok( $object, "Objecto creado" );
18 10 S->{'object'} = $object;
19 2 };
20  
21 12 ▶Cuando qr/he agregado "(\w+)" al objeto/, sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
22 12 S->{'object'}->add( C->matches->[0] );
23 2 };
24
25 2 ▶Cuando "he agregado los siguientes datos al objeto", sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
26 2 S->{'object'}->add( C->data );
27 2 };
28  
29 14 ▶Entonces qr/el resultado (?:en\s*)?(\w+) es "(.+)"/, sub {
Subroutine __ANON__: called CC=1 SCAR=0.0
30 14 my ( $type, $expected ) = @{ C->matches };
31 my $method = {
32 'base64' => 'b64digest',
33 'hexadecimal' => 'hexdigest'
34 14 }->{$type};
35  
36 14 is( S->{'object'}->$method(), $expected );
37 2 };
« examples/digest/features/step_definitions/basic_steps.pl ↑ Summary examples/tagged-digest/features/step_definitions/basic_steps.pl »