AliSoftware / AliSoftware/OHHTTPStubs
Manually triggering a response when ready, instead of relying on request time
- Ngôn ngữ chính
- Objective-C
- Star
- 5.1k
- Fork
- 597
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Mô tả
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?
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Đánh giá
Issue này chưa được đánh giá.