1

Is there a way of knowing how many requests are happening when you run your tests and could be cached by VCR.

Is there a way of knowing how many of those are getting read from the VCR cache?

Thanks

fabro
  • 731
  • 6
  • 11

1 Answers1

2

Take a look at After Http Request Hook:

VCR.configure do |c|
  c.cassette_library_dir = 'cassettes'
  c.ignore_localhost = true
  c.after_http_request(:ignored?, lambda { |req| req.uri =~ /foo/ }) do |request, response|
    puts "Response for #{request.method} #{request.uri}: #{response.body}"
  end
end

Or you can enable debug logging:

VCR.configure do |c|
  c.hook_into :webmock
  c.cassette_library_dir = 'cassettes'
  c.debug_logger = File.open(ARGV.first, 'w')
end
Alexey Shein
  • 7,342
  • 1
  • 25
  • 38