The Cucumber Book, Second Edition: Chapter 10

a03pl
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
Popular Prag Prog topics










Other popular topics










Latest in PragProg
Latest (all)
Categories:
Popular Portals
- /elixir
- /opensuse
- /rust
- /kotlin
- /ruby
- /erlang
- /python
- /clojure
- /react
- /quarkus
- /go
- /vapor
- /v
- /react-native
- /wasm
- /security
- /django
- /nodejs
- /centos
- /haskell
- /rails
- /fable
- /gleam
- /swift
- /js
- /deno
- /assemblyscript
- /tailwind
- /laravel
- /symfony
- /phoenix
- /crystal
- /typescript
- /debian
- /adonisjs
- /julia
- /arch-linux
- /svelte
- /spring
- /c-plus-plus
- /preact
- /flutter
- /actix
- /java
- /angular
- /ocaml
- /zig
- /kubuntu
- /scala
- /zotonic
- /vim
- /rocky
- /lisp
- /html
- /keyboards
- /emacs
- /nim
- /vuejs
- /nerves
- /elm