Registry / testing / webmock

webmock

JSON →
library3.26.2rbrubygemsunverified

WebMock allows stubbing HTTP requests and setting expectations on HTTP requests.

gem install webmock
INSTALL
IMPORT
SIG · WEBMOCK
W
webmock
testingrubyv3.26.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

WebMock
require 'webmock'

Stub an HTTP GET request and verify the response

require 'webmock' require 'net/http' WebMock.stub_request(:get, "http://example.com").to_return(body: "stubbed") response = Net::HTTP.get(URI("http://example.com")) puts response
Debug
Known issues
gotchaWebMock can interfere with real HTTP requests if not properly disabled
fix
Use WebMock.disable! in production or ensure stubs cover all requests
affects: >= 1.0.0
Upgrade
Version history
3.26.2latest on RubyGems
Audit
Dependencies

No dependency data recorded yet.

Agent activity
15 hits · last 30 days
node
12
Resources
webmock — gem install webmock · libregistry