File Coverage

examples/digest/features/step_definitions/basic_steps.pl
Criterion Covered Total %
statement 55 55 100.0
branch n/a
condition n/a
subroutine 15 15 100.0
pod n/a
total 70 70 100.0


line stmt bran cond sub pod time code
1             #!perl
2              
3 6     6   70 use strict;
  6         18  
  6         282  
4 6     6   55 use warnings;
  6         17  
  6         350  
5              
6 6     6   3380 use Digest;
  6         5173  
  6         265  
7 6     6   53 use Test::More;
  6         15  
  6         100  
8              
9 6     6   2593 use Test::BDD::Cucumber::StepFile;
  6         17  
  6         15834  
10              
11 6     6   1881 Given qr/a usable "(\w+)" class/, sub { use_ok( C->matches->[0] ); };
  6     6   28  
  6     6   12  
  6     6   121  
  6     6   1633  
  6     1   14  
  6     1   14  
  6     1   127  
  6     1   1951  
  6     1   16  
  6         13  
  6         111  
  6         1597  
  6         16  
  6         12  
  6         105  
  6         1550  
  6         13  
  6         12  
  6         99  
  1         184  
  1         2  
  1         1  
  1         13  
  1         209  
  1         2  
  1         2  
  1         15  
  1         213  
  1         2  
  1         1  
  1         40  
  1         187  
  1         3  
  1         2  
  1         14  
  1         198  
  1         2  
  1         2  
  1         13  
12              
13             Given qr/a Digest (\S+) object/, sub {
14             my $object = Digest->new( C->matches->[0] );
15             ok( $object, "Object created" );
16             S->{'object'} = $object;
17             };
18              
19             When qr/I've added "(.+)" to the object/, sub {
20             S->{'object'}->add( C->matches->[0] );
21             };
22              
23             When "I've added the following to the object", sub {
24             S->{'object'}->add( C->data );
25             };
26              
27             Then qr/the (.+) output is "(.+)"/, sub {
28             my ( $type, $expected ) = @{ C->matches };
29             my $method = {
30             'base64' => 'b64digest',
31             'hex' => 'hexdigest'
32             }->{$type};
33              
34             is( S->{'object'}->$method, $expected );
35             };