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
174 def disable!
175   return unless @original_session
176 
177   HTTPX.send(:remove_const, :Session)
178   HTTPX.send(:const_set, :Session, @original_session)
179 end
enable!()
[show source]
    # File lib/httpx/adapters/webmock.rb
165 def enable!
166   @original_session ||= HTTPX::Session
167 
168   webmock_session = HTTPX.plugin(Plugin)
169 
170   HTTPX.send(:remove_const, :Session)
171   HTTPX.send(:const_set, :Session, webmock_session.class)
172 end