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
166 def disable!
167   return unless @original_session
168 
169   HTTPX.send(:remove_const, :Session)
170   HTTPX.send(:const_set, :Session, @original_session)
171 end
enable!()
[show source]
    # File lib/httpx/adapters/webmock.rb
157 def enable!
158   @original_session ||= HTTPX::Session
159 
160   webmock_session = HTTPX.plugin(Plugin)
161 
162   HTTPX.send(:remove_const, :Session)
163   HTTPX.send(:const_set, :Session, webmock_session.class)
164 end