Open-Awesome
CategoriesAlternativesStacksSelf-HostedExplore
Open-Awesome

© 2026 Open-Awesome. Curated for the developer elite.

TermsPrivacyAboutGitHubRSS
  1. Home
  2. Gems
  3. VCR

VCR

NOASSERTIONRubyv6.4.0

A Ruby library that records HTTP interactions and replays them for fast, deterministic tests.

Visit WebsiteGitHubGitHub
6.1k stars510 forks0 contributors

What is VCR?

VCR is a Ruby gem that records HTTP requests and responses during test runs and saves them as 'cassettes' for future replay. It solves the problem of slow, flaky tests that depend on external web services by eliminating real network calls, making tests fast, deterministic, and accurate. Developers use it to isolate their test suites from network conditions and third-party service availability.

Target Audience

Ruby developers writing tests for applications that make HTTP requests to external APIs or web services, especially those using RSpec, Cucumber, Test::Unit, or Minitest.

Value Proposition

VCR is the de facto standard for HTTP recording in Ruby because of its extensive library support, simple configuration, and robust cassette management. It offers a unique balance of ease-of-use and flexibility, allowing precise control over request matching and response replay without sacrificing test realism.

Overview

Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.

Use Cases

Best For

  • Testing applications that consume third-party REST APIs
  • Ensuring test suite reliability when external services are unstable or offline
  • Speeding up test suites by eliminating slow HTTP requests
  • Creating deterministic integration tests for web service clients
  • Isolating tests from network conditions and API rate limits
  • Recording and inspecting HTTP traffic for debugging purposes

Not Ideal For

  • Testing applications with APIs that have highly volatile or non-deterministic responses (e.g., real-time data feeds), as cassettes can quickly become outdated.
  • Projects requiring live HTTP calls in all test environments for compliance audits or accuracy validation, since VCR disables unauthorized requests.
  • Teams using non-Ruby stacks or needing cross-language HTTP mocking, as VCR is Ruby-specific and ports in other languages are separate projects.
  • Scenarios where lightweight, in-code mocks are preferred over file-based fixtures to avoid cassette management overhead.

Pros & Cons

Pros

Broad HTTP Library Support

Integrates with WebMock, Typhoeus, Faraday, Excon, and supports libraries like Net::HTTP, Mechanize, and HTTParty, making it versatile for most Ruby HTTP clients.

Automatic Recording & Replay

Records HTTP interactions with minimal setup code, as shown in the simple configuration example, and replays them for fast, deterministic tests.

Flexible Cassette Management

Cassettes are stored in YAML or JSON, support ERB for dynamic responses, and allow different responses per test, providing fine-grained control over test data.

Sensitive Data Filtering

Includes configuration options to filter sensitive information like API keys from recorded cassettes, keeping test data secure, as mentioned in the documentation link.

Cons

Maintenance and Project Health

The README explicitly states 'Help Wanted' for maintainers, indicating potential delays in updates and support, which could be a risk for long-term projects.

Cassette Staleness Risk

Static cassette recordings can become outdated if external APIs change, requiring manual re-recording or configuration for automatic updates, which adds maintenance burden.

Setup Complexity for Advanced Use

While basic setup is simple, integrating with specific HTTP libraries or configuring custom matchers can be complex, as evidenced by the extensive documentation and dependency on stubbing libraries like WebMock.

Frequently Asked Questions

Quick Stats

Stars6,076
Forks510
Contributors0
Open Issues77
Last commit1 month ago
CreatedSince 2010

Tags

#webmock#integration-testing#deterministic-tests#testing#test-automation#test-fixtures#rspec#ruby#http-mocking#cucumber

Built With

R
Ruby

Links & Resources

Website

Included in

Microservices14.2kRuby14.1kGems2.8k
Auto-fetched 13 hours ago

Related Projects

GoreplayGoreplay

GoReplay is an open-source tool for capturing and replaying live HTTP traffic into a test environment in order to continuously test your system with real data. It can be used to increase confidence in code deployments, configuration changes and infrastructure changes.

Stars19,300
Forks90
Last commit5 months ago
fakerfaker

A library for generating fake data such as names, addresses, and phone numbers.

Stars11,914
Forks3,211
Last commit2 days ago
CapybaraCapybara

Acceptance test framework for web applications

Stars10,166
Forks1,473
Last commit11 days ago
CapybaraCapybara

Acceptance test framework for web applications

Stars10,166
Forks1,473
Last commit11 days ago
Community-curated · Updated weekly · 100% open source

Found a gem we're missing?

Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.

Submit a projectStar on GitHub