finds.dev

wycats/artifice

Replaces Net::HTTP with a subclass that routes all requests to a Rack application

View on GitHubHomepage ↗

★ 211RubyMITupdated May 2022

// the take

Artifice monkey-patches Net::HTTP to route all outbound HTTP requests to a local Rack app instead of the network. It's a test helper for Ruby code that makes HTTP calls you want to intercept without spinning up a real server.

Works at the Net::HTTP level so it intercepts everything that goes through it, including gems that don't expose their HTTP client. Block form for scoped activation is clean — no setup/teardown ceremony. Lets you use Sinatra or Rails routing to build realistic mock endpoints rather than hand-rolling response strings.

Dead project — last commit 2022, 211 stars, 12 forks, no releases in years. Only intercepts Net::HTTP; anything using Faraday with a non-Net::HTTP adapter, HTTParty configured differently, or libcurl bindings will slip right through. WebMock and VCR have largely superseded this with broader adapter support and more control. No thread-safety story for the global activation state.

We read the README, the directory tree and a key source file in July 2026. Nobody pays to be listed. How we judge →

// at a glance

Stars
211
Forks
12
Language
Ruby
License
MIT
Last commit
27 May 2022

// nearby

If artifice isn't quite it.

All repos →