Class: WebMock::HttpLibAdapters::AsyncHttpClientAdapter

Inherits:
WebMock::HttpLibAdapter show all
Defined in:
lib/webmock/http_lib_adapters/async_http_client_adapter.rb

Constant Summary collapse

OriginalAsyncHttpClient =
Async::HTTP::Client

Class Method Summary collapse

Methods inherited from WebMock::HttpLibAdapter

adapter_for

Class Method Details

.disable!Object



24
25
26
27
# File 'lib/webmock/http_lib_adapters/async_http_client_adapter.rb', line 24

def disable!
  Async::HTTP.send(:remove_const, :Client)
  Async::HTTP.send(:const_set, :Client, OriginalAsyncHttpClient)
end

.enable!Object



19
20
21
22
# File 'lib/webmock/http_lib_adapters/async_http_client_adapter.rb', line 19

def enable!
  Async::HTTP.send(:remove_const, :Client)
  Async::HTTP.send(:const_set, :Client, Async::HTTP::WebMockClientWrapper)
end