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

Popular Pragmatic Bookshelf topics Top

jimmykiang
This test is broken right out of the box… — FAIL: TestAgent (7.82s) agent_test.go:77: Error Trace: agent_test.go:77 agent_test.go:...
New
jesse050717
Title: Web Development with Clojure, Third Edition, pg 116 Hi - I just started chapter 5 and I am stuck on page 116 while trying to star...
New
herminiotorres
Hi! I know not the intentions behind this narrative when called, on page XI: mount() |> handle_event() |> render() but the correc...
New
brian-m-ops
#book-python-testing-with-pytest-second-edition Hi. Thanks for writing the book. I am just learning so this might just of been an issue ...
New
patoncrispy
I’m new to Rust and am using this book to learn more as well as to feed my interest in game dev. I’ve just finished the flappy dragon exa...
New
hazardco
On page 78 the following code appears: <%= link_to ‘Destroy’, product, class: ‘hover:underline’, method: :delete, data: { confirm...
New
taguniversalmachine
It seems the second code snippet is missing the code to set the current_user: current_user: Accounts.get_user_by_session_token(session["...
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
Henrai
Hi, I’m working on the Chapter 8 of the book. After I add add the point_offset, I’m still able to see acne: In the image above, I re...
New
New

Other popular topics Top

Rainer
My first contact with Erlang was about 2 years ago when I used RabbitMQ, which is written in Erlang, for my job. This made me curious and...
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
Exadra37
I am asking for any distro that only has the bare-bones to be able to get a shell in the server and then just install the packages as we ...
New
PragmaticBookshelf
“A Mystical Experience” Hero’s Journey with Paolo Perrotta @nusco Ever wonder how authoring books compares to writing articles?...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
PragmaticBookshelf
Author Spotlight James Stanier @jstanier James Stanier, author of Effective Remote Work , discusses how to rethink the office as we e...
New
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
First poster: bot
Large Language Models like ChatGPT say The Darnedest Things. The Errors They MakeWhy We Need to Document Them, and What We Have Decided ...
New