Skip to content

Enabling and Disabling WebMock

Olia Kremmyda edited this page Mar 24, 2018 · 1 revision

Disabling and enabling WebMock

# Enable WebMock (all adapters)
WebMock.enable!

# Disable WebMock (all adapters)
WebMock.disable!

or only some http client adapters

# Enable WebMock for all libs except Patron
WebMock.enable!(except: [:patron])

# Disable WebMock for all libs except Net::HTTP
WebMock.disable!(except: [:net_http])