Recently I needed to ‘unstub’ a method in Mocha. Browsing Mocha documentation and googling yielded no results. Apparently, Mocha doesn’t support a concept of ‘unstubbing’, i.e. recovering original implementation of a method that has been stubbed. After a little hacking, I found out that it’s quite easy (though not necessarily elegant) to call original implementation.
Tag Archives: hack
Looking for an easy way to manage agile project?
- Hash bars - simple ASCII-art charts in your console, database or Excel
- Easy and flexible breadcrumbs for Rails
- A simple shuffle that proved not so simple after all
- Does stubbing make your tests brittle?
- Cookie handling in multi-domain applications in Ruby on Rails
- Blast from the past: Compaq commercials with John Cleese
- Self-referential many-to-many relations in Ruby on Rails
- The endless cycle of code vs docs
- 265,156 hits