When to use undef_method, and when to use remove_method?

Viewed 3399

I want to redefine a method, but avoid the warning associated with it. Should I use undef_method or remove_method to do so?

(Yes, redefining methods is a little hacky. I'm doing this because I have some memoization that I want to use when unit tests are being run, but not when the program itself is run.)

2 Answers
Related