My team uses the Mocha gem for stubbing in Rails. I understand how to stub a method with stubs
such that it does nothing, or returns a specific value, but is there a way to stub it such that it runs a certain line of code when called?
I'm looking for something like this:
object.stubs(:method).runs(p 'Hello world!')
Does this exist? I'm open to using additional gems, or implementing whatever methodology people come up with.