A summary of data about the Ruby ecosystem.

https://github.com/vcr/vcr

Record your test suite's HTTP interactions and replay them during future test runs for fast, deterministic, accurate tests.
https://github.com/vcr/vcr

Keywords from Contributors

activerecord mvc activejob rubygems rack rspec rubocop authorization sinatra crash-reporting

Last synced: about 4 hours ago
JSON representation

Repository metadata

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

README.md

vcr

CI status
GitHub tag (latest SemVer)
Version
OpenCollective
OpenCollective

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

Help Wanted

We're looking for more maintainers. If you'd like to help maintain a well-used gem please spend some time reviewing pull requests, issues, or participating in discussions.

Usage

Add the below to your spec_helper.rb file:

require 'rubygems'
require 'test/unit'
require 'vcr'

VCR.configure do |config|
  config.cassette_library_dir = "fixtures/vcr_cassettes"
  config.hook_into :webmock
end

class VCRTest < Test::Unit::TestCase
  def test_example_dot_com
    VCR.use_cassette("synopsis") do
      response = Net::HTTP.get_response(URI('http://www.iana.org/domains/reserved'))
      assert_match /Example domains/, response.body
    end
  end
end

Run this test once, and VCR will record the HTTP request to fixtures/vcr_cassettes/synopsis.yml. Run it again, and VCR will replay the response from iana.org when the HTTP request is made. This test is now fast (no real HTTP requests are made anymore), deterministic (the test will continue to pass, even if you are offline, or iana.org goes down for maintenance) and accurate (the response will contain the same headers and body you get from a real request). You can use a different cassette library directory (e.g., "test/vcr_cassettes").

NOTE: To avoid storing any sensitive information in cassettes, check out Filter Sensitive Data in the documentation.

Rails and Minitest:
Do not use 'test/fixtures' as the directory if you're using Rails and Minitest (Rails will instead transitively load any files in that directory as models).

Features

  • Automatically records and replays your HTTP interactions with minimal setup/configuration code.
  • Supports and works with the HTTP stubbing facilities of multiple libraries. Currently, the following are supported:
  • Supports multiple HTTP libraries:
  • Request matching is configurable based on HTTP method, URI, host, path, body and headers, or you can easily implement a custom request matcher to handle any need.
  • The same request can receive different responses in different tests--just use different cassettes.
  • The recorded requests and responses are stored on disk in a serialization format of your choice (currently YAML and JSON are built in, and you can easily implement your own custom serializer) and can easily be inspected and edited.
  • Dynamic responses are supported using ERB.
  • Optionally re-records cassettes on a configurable regular interval to keep them fresh and current.
  • Disables all HTTP requests that you don't explicitly allow.
  • Simple Cucumber integration is provided using tags.
  • Includes convenient RSpec macros and integration with RSpec 2 metadata.
  • Known to work well with many popular Ruby libraries including RSpec 1 & 2, Cucumber, Test::Unit, Capybara, Mechanize, Rest Client and HTTParty.
  • Includes Rack and Faraday middleware.
  • Supports filtering sensitive data from the response body

The docs come in two flavors:

  • The usage docs contain example-based documentation (VCR's Cucumber suite, in fact). It's a good place to look when you are first getting started with VCR, or if you want to see an example of how to use a feature.
  • The rubydoc.info docs contain API documentation. The API docs contain detailed info about all of VCR's public API.
  • See the CHANGELOG doc for info about what's new and changed.

There is also a Railscast (from 2011), which will get you up and running in no-time http://railscasts.com/episodes/291-testing-with-vcr.

Release Policy

VCR follows the principles of semantic versioning. The API documentation defines VCR's public API. Patch level releases contain only bug fixes. Minor releases contain backward-compatible new features. Major new releases contain backwards-incompatible changes to the public API.

Ruby Interpreter Compatibility

VCR versions 6.x are tested on the following ruby interpreters:

  • MRI 3.3
  • MRI 3.2
  • MRI 3.1
  • MRI 3.0
  • MRI 2.7
  • MRI 2.6

VCR 6.0.0 is the last version supporting >= 2.3.
VCR 6.1.0 is the last version supporting >= 2.6.
Upcoming releases will only explicitly support >= 2.7.

Development

  • Source hosted on GitHub.
  • Direct questions and discussions on GitHub Issues.
  • Report bugs/issues on GitHub Issues.
  • Pull requests are very welcome! Please include spec and/or feature coverage for every patch,
    and create a topic branch for every separate change you make.
  • See the Contributing
    guide for instructions on running the specs and features.
  • Code quality metrics are checked by Code Climate.
  • Documentation is generated with YARD (cheat sheet).
    To generate while developing:
yard server --reload

Ports in Other Languages

Related Projects

  • Mr. Video (Rails engine for managing VCR cassettes and episodes)

Similar Libraries in Ruby

Credits

Thanks also to the following people who have contributed patches or helpful suggestions:

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]






























Sponsors

Become a sponsor and get your logo on our README on Github with a link to your site. [Become a sponsor]































Owner metadata


GitHub Events

Total
Last Year

Committers metadata

Last synced: 3 days ago

Total Commits: 1,986
Total Committers: 189
Avg Commits per committer: 10.508
Development Distribution Score (DDS): 0.255

Commits in past year: 15
Committers in past year: 13
Avg Commits per committer in past year: 1.154
Development Distribution Score (DDS) in past year: 0.867

Name Email Commits
Myron Marston m****n@g****m 1480
Mislav Marohnić m****c@g****m 66
Olle Jonsson o****n@g****m 42
Kurtis Rainbolt-Greene me@k****e 39
Tony Miller m****l@g****m 28
Kurtis Rainbolt-Greene k****s@r****e 21
Nathaniel Bibler g****t@n****m 15
Jacob Green j****b@n****m 10
Jan Berdajs m****o@g****m 10
André Luis Leal Cardoso Jr a****r@g****m 9
Luke van der Hoeven h****t@g****m 7
Ivan Kapelyukhin i****n@s****m 6
Ryan Foster r****r@v****m 5
Alexander Wenzowski a****r@w****m 4
Ben Lavender b****a@g****m 4
Chris Gunther c****s@r****m 4
Jean byroot Boussier j****b@s****m 4
hirowatari K****n@h****a 4
Ian Cordasco g****v@g****m 3
Jason Rylance e****r@g****m 3
Leon Miller-Out l****n@s****m 3
Mattias Putman m****n@g****m 3
Mike Nicholaides m****s@g****m 3
Nelli K 7****x 3
Todd Lunter t****r@g****m 3
Vladimir Kochnev h****e@y****u 3
dependabot[bot] 4****] 3
vzvu3k6k v****k@g****m 3
Matt Brictson m****t@m****m 3
Ryan Burrows r****s@g****m 3
and 159 more...

Committer domains:


Issue and Pull Request metadata

Last synced: 3 days ago

Total issues: 100
Total pull requests: 127
Average time to close issues: 11 months
Average time to close pull requests: 3 months
Total issue authors: 86
Total pull request authors: 51
Average comments per issue: 3.63
Average comments per pull request: 1.42
Merged pull request: 88
Bot issues: 0
Bot pull requests: 3

Past year issues: 9
Past year pull requests: 14
Past year average time to close issues: 2 months
Past year average time to close pull requests: about 1 month
Past year issue authors: 7
Past year pull request authors: 9
Past year average comments per issue: 0.78
Past year average comments per pull request: 0.71
Past year merged pull request: 8
Past year bot issues: 0
Past year bot pull requests: 2

More stats: https://issues.ecosyste.ms/repositories/lookup?url=https://github.com/vcr/vcr

Top Issue Authors

  • olleolleolle (13)
  • chrishough (2)
  • mattbrictson (2)
  • SirNerdBear (1)
  • petergoldstein (1)
  • fatkodima (1)
  • A5308Y (1)
  • ishan123456789 (1)
  • AlanDonohoe (1)
  • nathany (1)
  • Fryguy (1)
  • bolshoytoster (1)
  • jasonfb (1)
  • david-a-wheeler (1)
  • FayeFang (1)

Top Pull Request Authors

  • olleolleolle (32)
  • andrehjr (14)
  • mattbrictson (4)
  • casperisfine (4)
  • aka47 (3)
  • dependabot[bot] (3)
  • bradshjg (3)
  • nellirx (3)
  • BADASSMERGE (2)
  • andrew (2)
  • joaoGabriel55 (2)
  • jamesmcguirepro (2)
  • aglundahl (2)
  • Earlopain (2)
  • mark-young-atg (2)

Top Issue Labels

  • enhancement (4)
  • help wanted (4)
  • bug (2)
  • threadsafety (2)
  • good first issue (2)
  • question (1)

Top Pull Request Labels

  • dependencies (3)
  • enhancement (2)
  • github_actions (2)
  • faraday (1)
  • bug (1)

Package metadata

gem.coop: vcr

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

  • Homepage: https://benoittgt.github.io/vcr
  • Documentation: http://www.rubydoc.info/gems/vcr/
  • Licenses: Hippocratic-2.1,MIT
  • Latest release: 6.4.0 (published 3 months ago)
  • Last Synced: 2026-03-31T08:44:35.795Z (2 days ago)
  • Versions: 72
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 149,759,217 Total
  • Docker Downloads: 1,609,192,030
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 0.059%
    • Docker downloads count: 0.062%
    • Downloads: 0.173%
  • Maintainers (4)
  • Funding:
    • https://opencollective.com/vcr
rubygems.org: vcr

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

  • Homepage: https://benoittgt.github.io/vcr
  • Documentation: http://www.rubydoc.info/gems/vcr/
  • Licenses: Hippocratic-2.1,MIT
  • Latest release: 6.4.0 (published 3 months ago)
  • Last Synced: 2026-03-31T02:00:35.313Z (2 days ago)
  • Versions: 72
  • Dependent Packages: 3,588
  • Dependent Repositories: 30,935
  • Downloads: 149,734,588 Total
  • Docker Downloads: 1,609,192,030
  • Rankings:
    • Dependent packages count: 0.014%
    • Downloads: 0.168%
    • Docker downloads count: 0.192%
    • Dependent repos count: 0.196%
    • Stargazers count: 0.203%
    • Average: 0.332%
    • Forks count: 1.219%
  • Maintainers (4)
  • Funding:
    • https://opencollective.com/vcr
proxy.golang.org: github.com/vcr/vcr

  • Homepage:
  • Documentation: https://pkg.go.dev/github.com/vcr/vcr#section-documentation
  • Licenses: other
  • Latest release: v6.4.0+incompatible (published 3 months ago)
  • Last Synced: 2026-03-30T04:01:21.638Z (3 days ago)
  • Versions: 70
  • Dependent Packages: 0
  • Dependent Repositories: 1
  • Rankings:
    • Stargazers count: 0.883%
    • Forks count: 1.292%
    • Average: 4.112%
    • Dependent repos count: 4.719%
    • Dependent packages count: 9.553%
gem.coop: mustwin-vcr

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

  • Homepage: http://vcr.github.io/vcr
  • Documentation: http://www.rubydoc.info/gems/mustwin-vcr/
  • Licenses: MIT
  • Latest release: 2.9.3 (published about 11 years ago)
  • Last Synced: 2026-03-30T04:01:20.037Z (3 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 3,780 Total
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 26.971%
    • Downloads: 80.914%
  • Maintainers (1)
rubygems.org: mustwin-vcr

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

  • Homepage: http://vcr.github.io/vcr
  • Documentation: http://www.rubydoc.info/gems/mustwin-vcr/
  • Licenses: MIT
  • Latest release: 2.9.3 (published about 11 years ago)
  • Last Synced: 2026-03-30T04:01:20.018Z (3 days ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 3,780 Total
  • Rankings:
    • Stargazers count: 0.184%
    • Forks count: 1.106%
    • Dependent packages count: 15.706%
    • Average: 29.419%
    • Dependent repos count: 46.782%
    • Downloads: 83.315%
  • Maintainers (1)
guix: ruby-vcr-expat

HTTP interaction recorder [old version]

  • Homepage: https://github.com/vcr/vcr
  • Documentation: https://git.savannah.gnu.org/cgit/guix.git/tree/gnu/packages/ruby-xyz.scm#n9499
  • Licenses: expat
  • Latest release: 5.0.0-0.842b2bf (published about 1 month ago)
  • Last Synced: 2026-03-02T18:59:31.793Z (about 1 month ago)
  • Versions: 1
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Rankings:
    • Dependent repos count: 0.0%
    • Dependent packages count: 0.0%
    • Average: 100%

Dependencies

Gemfile rubygems
  • curb ~> 0.9.0
  • em-http-request >= 0
  • faraday >= 0.9.2, < 2
  • jruby-openssl >= 0
  • patron = 0.6.3
  • typhoeus ~> 1.1.0
  • webrick >= 0
vcr.gemspec rubygems
  • aruba ~> 0.14.14 development
  • bundler ~> 2.0 development
  • codeclimate-test-reporter ~> 0.4 development
  • cucumber ~> 7.0 development
  • excon >= 0.62.0 development
  • faraday >= 0.11.0, < 2.0.0 development
  • hashdiff >= 1.0.0.beta1, < 2.0.0 development
  • httpclient >= 0 development
  • json >= 0 development
  • mime-types >= 0 development
  • pry ~> 0.9 development
  • pry-doc ~> 0.6 development
  • rack >= 0 development
  • rake >= 12.3.3 development
  • relish >= 0 development
  • rspec ~> 3.0 development
  • sinatra >= 0 development
  • test-unit ~> 3.4.4 development
  • timecop >= 0 development
  • webmock >= 0 development
  • yard >= 0 development
.github/workflows/test.yml actions
  • actions/checkout v2 composite
  • ruby/setup-ruby v1 composite

Score: 35.94366984943278