For example, I want to say b = double("book") in irb and play with the result.
In irb if I say
require 'rspec'
b = double("book")
I get an error. Ideas?
You can play around with RSpec test doubles in irb
by requiring "rspec/mocks/standalone"
:
$ irb
> require 'rspec/mocks/standalone'
> b = double("book")
=> #<RSpec::Mocks::Mock:0x3fd88d0157e8 @name="book">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With