| 1 |
Feature: Simple tests of Digest.pm |
| 2 |
As a developer planning to use Digest.pm |
| 3 |
I want to test the basic functionality of Digest.pm |
| 4 |
In order to have confidence in it |
| 5 |
|
| 6 |
Background: |
| 7 |
Given a usable Digest class |
| 8 |
|
| 9 |
Scenario: Check MD5 |
| 10 |
Given a Digest MD5 object |
| 11 |
When I've added "foo bar baz" to the object |
| 12 |
And I've added "bat ban shan" to the object |
| 13 |
Then the hex output is "bcb56b3dd4674d5d7459c95e4c8a41d5" |
| 14 |
Then the base64 output is "1B2M2Y8AsgTpgAmY7PhCfg" |
| 15 |
|
| 16 |
Scenario: Check SHA-1 |
| 17 |
Given a Digest SHA-1 object |
| 18 |
When I've added "<data>" to the object |
| 19 |
Then the hex output is "<output>" |
| 20 |
Examples: |
| 21 |
| data | output | |
| 22 |
| foo | 0beec7b5ea3f0fdbc95d0dd47f3c5bc275da8a33 | |
| 23 |
| bar | 62cdb7020ff920e5aa642c3d4066950dd1f01f4d | |
| 24 |
| baz | bbe960a25ea311d21d40669e93df2003ba9b90a2 | |
| 25 |
|
| 26 |
Scenario: MD5 longer data |
| 27 |
Given a Digest MD5 object |
| 28 |
When I've added the following to the object |
| 29 |
""" |
| 30 |
Here is a chunk of text that works a bit like a HereDoc. We'll split |
| 31 |
off indenting space from the lines in it up to the indentation of the |
| 32 |
first \"\"\" |
| 33 |
""" |
| 34 |
Then the hex output is "75ad9f578e43b863590fae52d5d19ce6" |
| 35 |
|
| 36 |
----------DIVIDER---------- |
| 37 |
--- |
| 38 |
line: 1 |
| 39 |
name: Simple tests of Digest.pm |
| 40 |
satisfaction: |
| 41 |
- As a developer planning to use Digest.pm |
| 42 |
- I want to test the basic functionality of Digest.pm |
| 43 |
- In order to have confidence in it |
| 44 |
scenarios: |
| 45 |
- |
| 46 |
background: 0 |
| 47 |
|
| 48 |
line: 9 |
| 49 |
name: Check MD5 |
| 50 |
steps: |
| 51 |
- |
| 52 |
data: ~ |
| 53 |
line: 10 |
| 54 |
text: a Digest MD5 object |
| 55 |
verb: Given |
| 56 |
verb_original: Given |
| 57 |
- |
| 58 |
data: ~ |
| 59 |
line: 11 |
| 60 |
text: I've added "foo bar baz" to the object |
| 61 |
verb: When |
| 62 |
verb_original: When |
| 63 |
- |
| 64 |
data: ~ |
| 65 |
line: 12 |
| 66 |
text: I've added "bat ban shan" to the object |
| 67 |
verb: When |
| 68 |
verb_original: And |
| 69 |
- |
| 70 |
data: ~ |
| 71 |
line: 13 |
| 72 |
text: the hex output is "bcb56b3dd4674d5d7459c95e4c8a41d5" |
| 73 |
verb: Then |
| 74 |
verb_original: Then |
| 75 |
- |
| 76 |
data: ~ |
| 77 |
line: 14 |
| 78 |
text: the base64 output is "1B2M2Y8AsgTpgAmY7PhCfg" |
| 79 |
verb: Then |
| 80 |
verb_original: Then |
| 81 |
- |
| 82 |
background: 0 |
| 83 |
|
| 84 |
line: 16 |
| 85 |
name: Check SHA-1 |
| 86 |
steps: |
| 87 |
- |
| 88 |
data: ~ |
| 89 |
line: 17 |
| 90 |
text: a Digest SHA-1 object |
| 91 |
verb: Given |
| 92 |
verb_original: Given |
| 93 |
- |
| 94 |
data: ~ |
| 95 |
line: 18 |
| 96 |
text: I've added "<data>" to the object |
| 97 |
verb: When |
| 98 |
verb_original: When |
| 99 |
- |
| 100 |
data: ~ |
| 101 |
line: 19 |
| 102 |
text: the hex output is "<output>" |
| 103 |
verb: Then |
| 104 |
verb_original: Then |
| 105 |
- |
| 106 |
background: 0 |
| 107 |
|
| 108 |
line: 26 |
| 109 |
name: MD5 longer data |
| 110 |
steps: |
| 111 |
- |
| 112 |
data: ~ |
| 113 |
line: 27 |
| 114 |
text: a Digest MD5 object |
| 115 |
verb: Given |
| 116 |
verb_original: Given |
| 117 |
- |
| 118 |
data: "Here is a chunk of text that works a bit like a HereDoc. We'll split\noff indenting space from the lines in it up to the indentation of the\nfirst \"\"\"\n" |
| 119 |
line: 28 |
| 120 |
text: I've added the following to the object |
| 121 |
verb: When |
| 122 |
verb_original: When |
| 123 |
- |
| 124 |
data: ~ |
| 125 |
line: 34 |
| 126 |
text: the hex output is "75ad9f578e43b863590fae52d5d19ce6" |
| 127 |
verb: Then |
| 128 |
verb_original: Then |