[recorder] add option to load cassette from embed.Fs
Describe your changes
I want a way to load fixtures from an embedded filesystem, so I can use the recorder for my integration tests but also to create fakes that I use while my process is running (development / sandbox mode / etc)
This PR adds an option to create a recorder with an embedded filesystem, and if set optionally loads the cassette from it.
I didn't spend much time making the code nice, it is a little messy for my taste but it does work. If there is support for the idea Im happy to make any adjustments necessary to get the PR merged.
Checklist before requesting a review
tests pass
Hey @johnshiver ,
Thanks for the PR! I'll try to review it tomorrow and provide some feedback. Thanks again!
Codecov Report
Merging #83 (0d189b6) into v3 (035acaf) will decrease coverage by
4.08%. The diff coverage is48.43%.
:mega: This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more
@@ Coverage Diff @@
## v3 #83 +/- ##
==========================================
- Coverage 77.69% 73.61% -4.08%
==========================================
Files 1 1
Lines 278 326 +48
==========================================
+ Hits 216 240 +24
- Misses 48 72 +24
Partials 14 14
| Impacted Files | Coverage Δ | |
|---|---|---|
| recorder/recorder.go | 73.61% <48.43%> (-4.08%) |
:arrow_down: |
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.