Doublespeak: Remove warnings when re-doubling methods

This commit is contained in:
Elliot Winkler 2015-02-28 22:57:54 -07:00
parent 0300be8adc
commit 696f1d8536
1 changed files with 4 additions and 0 deletions

View File

@ -63,6 +63,10 @@ module Shoulda
implementation = @implementation
_method_name = method_name
if klass.instance_methods(false).include?(method_name)
klass.__send__(:remove_method, method_name)
end
klass.__send__(:define_method, method_name) do |*args, &block|
call = MethodCall.new(
double: double,