AliSoftware / AliSoftware/OHHTTPStubs

Manually triggering a response when ready, instead of relying on request time

Ouverte
#167 2 commentaires 0 réactions 0 personnes assignées Voir sur GitHub
Enhancement Waiting for input
Langage dominant
Objective-C
Étoiles
5.1k
Forks
597
Métriques de merge des PR
Aucune PR mergée en 30 j

Description

Would it be possible to stall responses, and trigger when I want the response to be sent?

My situation is that I'm stubbing a "post" upload to AWS, which starts in the background as soon as a user selects a photo. Then the user types in the post description and taps "submit". After this, I need to write some tests to ensure that the "uploading" view is visible, and to ensure that the upload can be cancelled.

Right now I'm setting the request time to 10 seconds, which gives us enough time to run these tests. But it would be great if I could store the `OHHTTPStubsResponse` in a variable, and then call something like `respond()` as soon as the tests are finished. I'm not a big fan of relying on a fixed request time, because it makes our tests slow, and it also might not be long enough if we're running on a slow CI machine.

I took a quick a look at the code, and I think I can refactor it to make this possible.

Would you be interested in adding this feature?

Guide de contribution

Aucun guide de contribution indexé pour ce dépôt

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.