AliSoftware / OHHTTPStubs

Stub your network requests easily! Test your apps with fake network data and custom response time, response code and headers!
MIT License
5.03k stars 601 forks source link

Add support to WatchOS #286

Open linksmt opened 6 years ago

linksmt commented 6 years ago

Checklist

Description

Motivation and Context

tfonfara commented 6 years ago

I'm a bit concerned if those changes are enough, as there is on several places code like #if defined(__IPHONE_7_0), that should be extended with __WATCHOS_2_0

AliSoftware commented 6 years ago

good point.

AliSoftware commented 6 years ago

Ping @linksmt about the #if defined(__IPHONE_7_0) remark above 😉

tfonfara commented 5 years ago

I tried to come up with a solution by myself, but things are petty weird. I've added all necessary precompiler defines, but OHHTTPStubsProtocol isn't working properly. canInitWithRequest is being called and also returns true, but neither initWithRequest nor startLoading gets called. I also tried with a simple approach in a fresh project to implement NSURLProtocol but found same behaviour.

linksmt commented 5 years ago

Can you accept merge? Thanks

jeffctown commented 5 years ago

@linksmt thank you for submitting this!

Everything looks great for the added target, but I think we should probably have some tests to go along with it so we can make sure we don't break it. 😄

Would you be comfortable adding some tests to the watchOS target?

I think it would also be helpful if you update the CHANGELOG.md to give yourself credit and update the original description of this PR.

1ec5 commented 4 years ago

Would you be comfortable adding some tests to the watchOS target?

Unless I’m missing something, Xcode doesn’t support watchOS test targets yet.

Juanpe commented 3 years ago

Hi! @AliSoftware @linksmt, what is the status of this PR? I mean, OHHTTPStubs is still not supporting watchOS, doesn't it?