a03pl

a03pl

The Cucumber Book, Second Edition: Chapter 10

Title: Name of book: The Cucumber Book, 2nd ed - Chapter 10
Example: Neither working through the example code nor downloading the code and using that works. The errors I get when running the code I worked through are as follows:

Scenario: Successful withdrawal from an account in credit # features/cash_withdrawal.feature:2
Given my account has been credited with $100 # features/step_definitions/account_steps.rb:1
Validation failed: Number has already been taken (ActiveRecord::RecordInvalid)
./features/support/world_extensions.rb:15:in my_account' ./features/step_definitions/account_steps.rb:2:in /^my account has been credited with $(\d+)$/’
features/cash_withdrawal.feature:3:in `Given my account has been credited with $100’
When I withdraw $20 # features/step_definitions/teller_steps.rb:3
Then $20 should be dispensed # features/step_definitions/cash_slot_steps.rb:1
And the balance of my account should be $80 # features/step_definitions/account_steps.rb:5

Failing Scenarios:
cucumber features/cash_withdrawal.feature:2 # Scenario: Successful withdrawal from an account in credit

1 scenario (1 failed)
4 steps (1 failed, 3 skipped)

I am not a Ruby programmer so I havent a clue what is going on here as I have faithfully replicated the example code in the book. Please help.

Thanks

First Post!

Margaret

Margaret

Editor at PragProg

@a03pl Hi John,

The author for this book is not on DevTalk, but I checked in with him, and unfortunately, he has moved on to other things and is not able to offer help and support for the book anymore. Perhaps some kind soul here on Devtalk who has some #ruby experience would be willing to help? Apologies for not being able to give you a solution.

Best wishes,
Margaret
The Pragmatic Bookshelf

Where Next?

Popular Pragmatic Bookshelf topics Top

GilWright
Working through the steps (checking that the Info,plist matches exactly), run the demo game and what appears is grey but does not fill th...
New
herminiotorres
Hi @Margaret , On page VII the book tells us the example and snippets will be all using Elixir version 1.11 But on page 3 almost the en...
New
cro
I am working on the “Your Turn” for chapter one and building out the restart button talked about on page 27. It recommends looking into ...
New
brunogirin
When installing Cards as an editable package, I get the following error: ERROR: File “setup.py” not found. Directory cannot be installe...
New
dsmith42
Hey there, I’m enjoying this book and have learned a few things alredayd. However, in Chapter 4 I believe we are meant to see the “>...
New
AufHe
I’m a newbie to Rails 7 and have hit an issue with the bin/Dev script mentioned on pages 112-113. Iteration A1 - Seeing the list of prod...
New
taguniversalmachine
Hi, I am getting an error I cannot figure out on my test. I have what I think is the exact code from the book, other than I changed “us...
New
andreheijstek
After running /bin/setup, the first error was: The foreman' command exists in these Ruby versions: That was easy to fix: gem install fore...
New
dtonhofer
@parrt In the context of Chapter 4.3, the grammar Java.g4, meant to parse Java 6 compilation units, no longer passes ANTLR (currently 4....
New
bjnord
Hello @herbert ! Trying to get the very first “Hello, Bracket Terminal!" example to run (p. 53). I develop on an Amazon EC2 instance runn...
New

Other popular topics Top

New
AstonJ
Inspired by this post from @Carter, which languages, frameworks or other tech or tools do you think is killing it right now? :upside_down...
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
New
PragmaticBookshelf
Author Spotlight: Peter Ullrich @PJUllrich Data is at the core of every business, but it is useless if nobody can access and analyze ...
New
AstonJ
This is cool! DEEPSEEK-V3 ON M4 MAC: BLAZING FAST INFERENCE ON APPLE SILICON We just witnessed something incredible: the largest open-s...
New
AstonJ
Curious what kind of results others are getting, I think actually prefer the 7B model to the 32B model, not only is it faster but the qua...
New

Sub Categories: