samedi 23 mai 2015

How to mock http.Head()

I'm studying the outyet example project from http://ift.tt/1SsNy6Y. The test file does not cover the case where http.Head(url) returns an error. I would like to extend the unit tests to cover the if statement where the error is logged (http://ift.tt/1RciDdL). I would like to mock http.Head(), but I'm not sure how to do this. How can this be done?

Aucun commentaire:

Enregistrer un commentaire