venmo / DVR

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

Handling nil response a bit more gracefully #4

Closed czechboy0 closed 9 years ago

czechboy0 commented 9 years ago

Made the problem when response is nil a bit more obvious (+ removed a forced unwrap, FTW!) I encountered this when https failed to validate a certificate - response was nil, which crashed on the force unwrap during the creation of Interaction. If this happens now, it should be a bit more obvy.

soffes commented 9 years ago

Love this. Can you PR a test for this too?

czechboy0 commented 9 years ago

Hmm, do you know how to test that fatalError was called?

soffes commented 9 years ago

Oh actually, now that you mention it, I don't :( Wish I did so I could test more things in DVR.

czechboy0 commented 9 years ago

Well, if you ever do come up with a way (or migrate to throwing Swift errors), here's the test: https://github.com/czechboy0/DVR/commit/613995a0f6f45464dc858b883db26e034bf9003c

soffes commented 9 years ago

:heart: