Skip to content

Instantly share code, notes, and snippets.

@wflanagan
Last active October 9, 2018 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wflanagan/59f0434d11079ace97ed4679d503d31d to your computer and use it in GitHub Desktop.
Save wflanagan/59f0434d11079ace97ed4679d503d31d to your computer and use it in GitHub Desktop.
Retrieve only once example
RSpec.describe 'example' do
kinds.each do |kind|
context kind.to_s, vcr: true do
let(:helper) do
helper = HTTP.get("http://#{kind}.com/")
helper
end
# retrieves here
it "ok?" do
expect(helper.code).to eq 200
end
# re-retrieves here
it 'has_items' do
expect(helper.items.length).to be > 0
end
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment