Skip to content

Instantly share code, notes, and snippets.

@pat
Created July 7, 2022 11:39
Show Gist options
  • Save pat/afe672c1f646c23413d8a44477ae0052 to your computer and use it in GitHub Desktop.
Save pat/afe672c1f646c23413d8a44477ae0052 to your computer and use it in GitHub Desktop.
# frozen_string_literal: true
VCR.configure do |config|
config.cassette_library_dir = Rails.root.join("spec/cassettes")
config.hook_into :webmock
config.ignore_hosts "127.0.0.1", "analytics-api.buildkite.com"
end
# Re-use directory structure within spec/features, to keep cassettes namespaced.
VCRAssistant.namer = Class.new(VCRAssistant::FileName) do
def folder
example.metadata[:file_path][%r{\.?/?spec/features/(.+)_spec.rb$}, 1]
end
end
RSpec.configure do |config|
config.around(:each, :live) do |example|
assisted_cassette(example) do |_assistant|
Timecop.freeze(Time.gm(2021))
example.run
Timecop.return
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment