rspec: How to stub an instance method called by constructor?
Here’s the commit which adds the feature to rspec – This was on May 25 2008. With this you can do A.any_instance.stub(do_something: 23) However, the latest gem version of rspec (1.1.11, October 2008) doesn’t have this patch in it. This ticket states that they yanked it out for maintenance reasons, and an alternative solution hasn’t … Read more