Mock Method Chain Calls With RSpec
Last updated
Was this helpful?
Last updated
Was this helpful?
Generally with RSpec you mock one method call at a time:
Sometimes you are dealing with code that involves a chain of method calls.
If it becomes unreasonable to mock out each individual method, you can instead mock out the chain of calls.
Alternatively, you can write this as: