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


22
23
24
25
# File 'lib/webmock/http_lib_adapters/async_http_client_adapter.rb', line 22

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

.enable!Object


17
18
19
20
# File 'lib/webmock/http_lib_adapters/async_http_client_adapter.rb', line 17

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