More Expectation Annotations
Let's learn about stub methods, testing with mock objects, and mock object arguments.
RSpec allows several different annotations to the expectation part of declaring a test double. We can specify more complex return values or a variety of arguments to the stubbed method.
Stubbing return values
A couple of advanced usages of returns
may be valuable now and again. If we have multiple return values specified, the stubbed method returns one at a time (spec added on line 21):
Get hands-on with 1400+ tech skills courses.