Method: Mocha::ClassMethod#restore_original_method
- Defined in:
- lib/mocha/class_method.rb
#restore_original_method ⇒ Object
51 52 53 54 55 56 57 58 59 60 |
# File 'lib/mocha/class_method.rb', line 51 def restore_original_method if method_exists?(hidden_method) begin stubbee..send(:alias_method, method, hidden_method) stubbee..send(:remove_method, hidden_method) rescue NameError # deal with nasties like ActiveRecord::Associations::AssociationProxy end end end |