Recently I had a problem with a module that overrode the
stub method with something that was not compatible with RSpec's
stub. I still needed the original method in some places so I could not just remove it.
Assuming the following code:
class Cat < Animal
cat = Cat.new
cat.speak # Says "Mew..."
And assuming we want now to be able to access the original
speak method from a
alias_method :mew, :speak
remove_method :speak # removes Cat#speak, not Animal#speak
cat.speak # Says "..."
cat.mew # Says "Mew..."