Created
May 14, 2019 19:22
-
-
Save juanmanuelramallo/cc021ba1cfd6a8e1ae70ac467b77cb1e to your computer and use it in GitHub Desktop.
A simple helper to use vcr in tests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RSpec.configure do |c| | |
c.around(:each, :vcr) do |example| | |
name = example.metadata[:full_description].split(/\s+/, 2).join('/').underscore.gsub(%r{/[^\w\/]+/}, '_') | |
VCR.use_cassette(name) { example.call } | |
end | |
end | |
# Usage | |
# it 'should create a new credit card with given information', :vcr do |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment