govcr is a Go library that records and replays HTTP/HTTPS interactions for testing purposes, acting as an HTTP mock. It wraps an http.Client to intercept requests, either playing back recorded responses from cassette files (JSON) or making live requests and recording them. The library supports various modes (normal, live-only, offline, read-only), cassette encryption (AES-GCM, ChaCha20Poly1305), multiple storage backends (local filesystem, AWS S3), flexible request matching, and request/response transformation via mutators. The architecture centers around a custom http.RoundTripper implementation that integrates cassette storage, request matching, mutation systems, and encryption layers.
Stripe-ruby-mock is a Ruby library that provides in-memory mocking of the Stripe API for testing purposes. It intercepts Stripe HTTP requests and returns simulated responses, enabling offline, deterministic testing without real API keys or network access. The library supports both local mocking (via `StripeMock.start`/`stop`) and a remote mock server for integration tests across processes. It covers a wide range of Stripe endpoints including charges, customers, subscriptions, invoices, payment intents, and webhooks, with extensive shared RSpec examples and webhook fixtures. The architecture follows a modular request-handler pattern, with helpers for token generation, param validation, and search simulation. While the codebase is well-structured and popular (996 stars), it shows signs of maintenance strain (199 open issues, call for core maintainers) and technical drift (vendored Trollop CLI parser, outdated webhook fixtures, limited Stripe API version coverage). It remains a valuable tool for legacy Stripe testing but may require updates to fully align with current Stripe API changes.