class WebMock::HttpLibAdapters::NetHttpAdapter
def self.disable!
def self.disable! Net.send(:remove_const, :HTTP) Net.send(:const_set, :HTTP, OriginalNetHTTP) if HAS_LEGACY_CONSTANT remove_silently(Net, :HTTPSession) Net.send(:const_set, :HTTPSession, OriginalNetHTTP) end #copy all constants from @webMockNetHTTP to original Net::HTTP #in case any constants were added to @webMockNetHTTP instead of Net::HTTP #after WebMock was enabled. #i.e Net::HTTP::DigestAuth @webMockNetHTTP.constants.each do |constant| if !OriginalNetHTTP.constants.map(&:to_s).include?(constant.to_s) OriginalNetHTTP.send(:const_set, constant, @webMockNetHTTP.const_get(constant)) end end end