Skip to content

Instantly share code, notes, and snippets.

@ttilberg
ttilberg / readme.md
Last active August 4, 2023 15:02
My MiniTest + VCR `with_vcr {}` selective recording configuration

Minitest Recordable

This small module sets up VCR in a way that makes using VCR in Minitest a breeze. You can wrap specific parts of your test in a with_vcr block that will automatically create and name a cassette and directory based on the test and class name, and handles nested names. It works great both from inside Rails, and not.

The example test file in this gist stores its results to test/vcr/Search_GoogleTest/test_search.yml.