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.
Category Archives: stub
Looking for an easy way to manage agile project?
- The simplest way to set-up a "we'll be back shortly" page
- Cookie handling in multi-domain applications in Ruby on Rails
- On salary negotiation during job interview
- Easy and flexible breadcrumbs for Rails
- Using assert's message to boost your unit testing productivity
- A simple shuffle that proved not so simple after all
- TextMate shortcuts you should be using
- 214,106 hits