# File lib/mocha/class_method.rb, line 72 def restore_original_method return if RUBY_V2_PLUS if @original_method && @original_method.owner == stubbee.__metaclass__ if PRE_RUBY_V19 original_method = @original_method stubbee.__metaclass__.send(:define_method, method) do |*args, &block| original_method.call(*args, &block) end else stubbee.__metaclass__.send(:define_method, method, @original_method) end end return unless @original_visibility Module.instance_method(@original_visibility).bind(stubbee.__metaclass__).call(method) end