class WebMock::HttpLibAdapters::HTTPClientAdapter

Constants

OriginalHttpClient
OriginalJsonClient

Public Class Methods

disable!() click to toggle source
# File lib/webmock/http_lib_adapters/httpclient_adapter.rb, line 33
def self.disable!
  Object.send(:remove_const, :HTTPClient)
  Object.send(:const_set, :HTTPClient, OriginalHttpClient)
  if defined? ::JSONClient
    Object.send(:remove_const, :JSONClient)
    Object.send(:const_set, :JSONClient, OriginalJsonClient)
  end
end
enable!() click to toggle source
# File lib/webmock/http_lib_adapters/httpclient_adapter.rb, line 24
def self.enable!
  Object.send(:remove_const, :HTTPClient)
  Object.send(:const_set, :HTTPClient, WebMockHTTPClient)
  if defined? ::JSONClient
    Object.send(:remove_const, :JSONClient)
    Object.send(:const_set, :JSONClient, WebMockJSONClient)
  end
end