class WebMock::HttpLibAdapters::HttpxAdapter

  1. lib/httpx/adapters/webmock.rb
Superclass: HttpLibAdapter

Methods

Public Class

  1. disable!
  2. enable!

Public Class methods

disable!()
[show source]
    # File lib/httpx/adapters/webmock.rb
180 def disable!
181   return unless @original_session
182 
183   HTTPX.send(:remove_const, :Session)
184   HTTPX.send(:const_set, :Session, @original_session)
185 end
enable!()
[show source]
    # File lib/httpx/adapters/webmock.rb
171 def enable!
172   @original_session ||= HTTPX::Session
173 
174   webmock_session = HTTPX.plugin(Plugin)
175 
176   HTTPX.send(:remove_const, :Session)
177   HTTPX.send(:const_set, :Session, webmock_session.class)
178 end