Super Fast VCR Configuration for RSpec and MiniTest

RSpec and MiniTest

You determined to use VCR by reading following from the README:

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

But the README of VCR gem has a little clutter and the configuration mentioned there shows few deprecation warning when we run the spec.

Here is a configuration which will work best for most of the cases with RSpec (and also with minitest).

Configure following gems in Gemfile and bundle

Create following file as mentioned in the comment below

Modify rails_helper.rb/spec_helper.rb to add following line at the top

require 'support / vcr_setup'

You can now use it in your spec. I strongly recommend to Ryan Bates Video to get to know how VCR works.

Click here for more details…

At BoTree Technologies, we build enterprise applications with our RoR team of 25+ engineers.

We also specialize in Python, RPA, AI, Django, JavaScript and ReactJS.

Consulting is free – let us help you grow!

Related posts

Top Libraries to use with Advanced React JS Applications!

by Ankur Vyas
7 years ago

Fast JSON API Serializer by Netflix in Ruby On Rails

by Jaydip Makwana
6 years ago

Vim for Ruby on Rails Development  -  Match made in Heaven

by Parth Barot
10 years ago
Exit mobile version