Ruby mocks

Topics: Ruby, Testing

In tests, a mock sets expected method calls and arguments as well as canned responses.

“A mock is a stub with an attitude. Along with knowing what canned responses to return, a mock also knows which methods should be called and with what arguments.” (Russ Olsen, Eloquent Ruby)