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?
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">
© 2022 - 2024 — McMap. All rights reserved.