Skip to content

Instantly share code, notes, and snippets.

@ardecvz
ardecvz / vcr_intro.rb
Last active January 28, 2024 22:52
A VCR trick to include preparation and cleanup phases for external services directly within the test files (the phases run ONLY when recording cassettes)
# frozen_string_literal: true
# A VCR trick to include preparation and cleanup phases for external services
# directly within the test files (the phases run ONLY when recording cassettes):
#
# RSpec.describe EvilMartiansAPI::Client, vcr: true do
# let(:client) { described_class.new }
#
# let(:developer_team_number) { 42 }
#
@ardecvz
ardecvz / 00_evil_martians_api_client.md
Last active April 18, 2024 20:35
A ready-to-use example that features an opinionated Faraday configuration, optionally serving as a starting point for your own HTTP client
├── bin
│   └── console
├── config
│   └── evil_martians_api.yml
├── lib
│   ├── evil_martians_api
│   │   ├── api
│   │   │   └── developers.rb
│ │ ├── client