AliSoftware / AliSoftware/OHHTTPStubs
Manually triggering a response when ready, instead of relying on request time
- Linguagem predominante
- Objective-C
- Estrelas
- 5.1k
- Forks
- 597
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Descrição
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?
Guia de contribuição
Nenhum guia de contribuição indexado para este repositório
Avaliação
Esta issue ainda não foi avaliada.