AliSoftware / AliSoftware/OHHTTPStubs

OHHTTPStubs not working with watchOS

未关闭
#287 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Objective-C
星标
5.1k
派生
597
PR 合并指标
30 天内没有已合并 PR

描述

### New Issue Checklist

- [x] I have tried with the latest version of OHHTTPStubs
- [x] I have read the [README](https://github.com/AliSoftware/OHHTTPStubs/blob/master/README.md)
- [x] I have read the [Using the right Swift Version of `OHHTTPStubs` for your project](https://github.com/AliSoftware/OHHTTPStubs#using-the-right-swift-version-of-ohhttpstubs-for-your-project) section
- [x] I have searched in the [existing issues](https://github.com/AliSoftware/OHHTTPStubs/issues?utf8=✓&q=is%3Aissue)
- [x] I have read [the OHHTTPStubs wiki](https://github.com/AliSoftware/OHHTTPStubs/wiki) to see if there wasn't a detailed page talking about my issue

### Environment

- version of OHHTTPStubs: 6.1.0
- integration method you are using:
* [x] Cocoapods
* [ ] Carthage
* [ ] submodule
* [ ] other
- version of the tool you use: 1.5.3

### Issue Description

Stubs are never considered for watchOS, same code runs fine in iOS.

### Steps to reproduce

1. Create an iOS + watchOS application
2. Add the following code in both apps, this should return empty data for all requests:
```
stub(condition: isScheme("http") || isScheme("https")) { _ in
return OHHTTPStubsResponse(data: Data(), statusCode: 200, headers: nil)
}
```
3. Add code to download any file and print contents

**Expectation**: Output should be empty in both apps (as the stubs are returning an empty data object)
**Results iOS**: Empty output is printed
**Results watchOS**: Actual file contents are printed, download was not stubbed

Can also be veryfied using breakpoints, for watchOS the return statement is never being called.

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。