Open soffes opened 8 years ago
Interesting. I wonder if it's worth copying VCR's block-/closure-style usage of cassettes as well, like:
VCR.use_cassette("Things") do
do_things
end
so maybe something like:
session.record("Things") { session in
session. dataTaskWithRequest(...)
}
Just kinda brainstorming!
Ya I like that approach. I wrote some VCR tests yesterday and really liked that. I'll think on it some more. VCR just replaces system networking with their own for you and we have to DI things.
I was thinking having
startRecording
/stopRecording
in a test is weird since you only record once. Those methods are used for batch requests in one cassette. It would probably be best if these were renamed tobeginBatch
andfinishBatch
(orendBatch
).