Login
From:
Robert Mosolgo
(Uncensored)
subscribe
Rspec should_receive stubs methods
https://rmosolgo.github.io/ruby/rspec/2013/09/28/rspec-should-receive-stubs-methods.html
links
backlinks
Roast topics
Find topics
Find it!
I learned this the hard way, so I thought I’d share. A great feature of Rspec is its should_receive method, which checks if a message was sent to an object sometime during that spec. For example, this test would pass: