Skip to content

Instantly share code, notes, and snippets.

@pikesley
Created October 23, 2015 16:01
Show Gist options
  • Save pikesley/735f67e939f6cd530888 to your computer and use it in GitHub Desktop.
Save pikesley/735f67e939f6cd530888 to your computer and use it in GitHub Desktop.
Extract the body from a VCR cassette
require 'yaml'
require 'json'
cassette = 'spec/vcr/Module_Class/some_cassette.yml'
body = (JSON.parse ((YAML.load File.read cassette)['http_interactions'][0]['response']['body']['string']))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment