venmo / DVR

Network testing for Swift
http://blog.soff.es/network-testing-in-swift-with-dvr
MIT License
651 stars 86 forks source link

Rename start/end recording to begin/finish batch #61

Open soffes opened 7 years ago

soffes commented 7 years ago

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 to beginBatch and finishBatch (or endBatch).

eliperkins commented 7 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!

soffes commented 7 years ago

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.