venmo / DVR

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

Alamofire Support #62

Closed rhysforyou closed 4 years ago

rhysforyou commented 7 years ago

Note: This PR depends on the changes in @soffes's Swift 3 branch (#60), once that's merged I'll rebase this on master.

This PR makes it possible to use DVR in projects that use Alamofire to do their networking. The Alamofire team got us most of the way towards supporting this (see https://github.com/Alamofire/Alamofire/pull/795) by allowing users to inject the URLSession and Alamofire.SessionDelegate used by a manager, but we still need to do some work on DVR's side to ensure it's calling the appropriate delegate methods and whatnot.

In a broader sense, this PR does the following:

It might also be worth updating the docs to include some instructions on using DVR with Alamofire since there's some stuff about it that's non-obvious. I'd be happy to write those if there's interest around this PR.

I've been using this in a production app's tests for a couple of days now and it works fantastically.

rhysforyou commented 7 years ago

Whoops, looks like it's calling some delegate methods multiple times, I'll look in to that

arnlen commented 7 years ago

This PR is open for a while. What's its status? Is DVR working with Alamofire?

getaaron commented 7 years ago

@rpowelll Are you still going to rebase this?

damianesteban commented 7 years ago

What is the status of this?