File Coverage

examples/tagged-digest/features/step_definitions/basic_steps.pl
Criterion Covered Total %
statement 70 70 100.0
branch n/a
condition n/a
subroutine 20 20 100.0
pod n/a
total 90 90 100.0


line stmt bran cond sub pod time code
1             #!perl
2              
3 3     3   26 use strict;
  3     1   7  
  3         104  
  1         12  
  1         2  
  1         42  
4 3     3   14 use warnings;
  3     1   4  
  3         137  
  1         7  
  1         2  
  1         79  
5              
6 3     3   1142 use Digest;
  3     1   1143  
  3         79  
  1         7  
  1         3  
  1         32  
7 3     3   17 use Test::More;
  3     1   5  
  3         38  
  1         6  
  1         2  
  1         9  
8 3     3   964 use Test::BDD::Cucumber::StepFile;
  3     1   7  
  3         4595  
  1         393  
  1         3  
  1         3074  
9              
10 2     2   489 Given qr/a usable "(\w+)" class/, sub { use_ok( C->matches->[0] ); };
  2     2   3  
  2     2   5  
  2     2   31  
  2     2   594  
  2     1   5  
  2     1   4  
  2     1   38  
  2     1   662  
  2     1   7  
  2         7  
  2         47  
  2         586  
  2         8  
  2         5  
  2         40  
  2         683  
  2         5  
  2         7  
  2         78  
  1         325  
  1         3  
  1         2  
  1         23  
  1         356  
  1         3  
  1         4  
  1         25  
  1         355  
  1         4  
  1         3  
  1         23  
  1         348  
  1         3  
  1         3  
  1         24  
  1         242  
  1         3  
  1         1  
  1         17  
11             Given qr/a Digest (\S+) object/, sub {
12             my $object = Digest->new( C->matches->[0] );
13             ok( $object, "Object created" );
14             S->{'object'} = $object;
15             };
16              
17             When qr/I've added "(.+)" to the object/, sub {
18             S->{'object'}->add( C->matches->[0] );
19             };
20              
21             When "I've added the following to the object", sub {
22             S->{'object'}->add( C->data );
23             };
24              
25             Then qr/the (.+) output is "(.+)"/, sub {
26             my ( $type, $expected ) = @{ C->matches };
27             my $method = {
28             'base64' => 'b64digest',
29             'hex' => 'hexdigest'
30             }->{$type};
31              
32             is( S->{'object'}->$method, $expected );
33             };