By Developers, For Developers

Historical errata for The Cucumber Book, Second Edition

PDF PgPaper PgTypeDescriptionFixed onComments
115ERROR

The regex in the first line of the transform does not correctly match the currency amount. The first $ should be escaped.

Incorrect line:
CAPTURE_CASH_AMOUNT = Transform(/^$(\\d+)$/) do |digits|

Should be:
CAPTURE_CASH_AMOUNT = Transform(/^\\$(\\d+)$/) do |digits|

130SUGGEST

“Fixing the Bug” section is missing instruction to add “And the balance of my account should be $80” to cash_withdrawl.feature before running cucumber to generate error on pdf page 132

130TYPO

The example of the updated Feature set at the bottom of the page has no difference between itself and immediate prior example.

Reads:

Feature: Cash Withdrawal
Scenario: Successful withdrawal from an account in credit
Given I have deposited $100 in my account
When I withdraw $20
Then $20 should be dispensed

Should Read:

Feature: Cash Withdrawal
Scenario: Successful withdrawal from an account in credit
Given I have deposited $100 in my account
When I withdraw $20
Then $20 should be dispensed
Then the balance of my account should be $80

130TYPO

You write:

Let’s tack on this extra outcome as another Then step:

support_code/01/features/cash_withdrawal.feature
Feature: Cash Withdrawal
Scenario: Successful withdrawal from an account in credit
Given I have deposited $100 in my account
When I withdraw $20
Then $20 should be dispensed

But you don’t add the second “Then” statement.

Categories: