How to Use RSpec Mocks (Step-By-Step Tutorial)
What is a mock in RSpec? (Or a mock in general, because this isn’t a concept unique to RSpec.) A mock is an object used for testing. You use mocks to test the interaction between two objects. Instead of testing the output value, like in a regular expectation. For example: You’re writing an API that … Read more