AliSoftware / AliSoftware/OHHTTPStubs

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

オープン
#167 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る
Enhancement Waiting for input
主要言語
Objective-C
スター
5.1k
フォーク
597
PR マージ指標
30日以内にマージされた PR はありません

説明

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?

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。