venmo / DVR

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

Add support for recording multiple network calls in one test run #6

Closed czechboy0 closed 8 years ago

czechboy0 commented 9 years ago

Since Cassette saves an array of Interactions, instead of just one, it would be great to add support for recording and replaying multiple interactions in one test case.

Possible changes for recording:

Possible changes for replaying:

???

Profit.

soffes commented 9 years ago

Been thinking about this a lot too since first writing all of this. I was thinking it could work like UITableView stuff. So you can call insertRow... by itself to just insert one animated or you can use beginEditing & endEditing to group them together. This way, we don't break the current API and you can do multiple. Thoughts? cc @ayanonagon @hyperspacemark

ayanonagon commented 9 years ago

I def like the idea of not breaking the current API and modeling it after something that is familiar to most Cocoa developers (like UITableView). :octocat:

czechboy0 commented 9 years ago

It looks like we will always need two variables/calls. In my suggestion above, it was recordMultiple and finishRecording(), in your case it could be startBatchRecording and endBatchRecording. I probably like your solution better, though. :+1: