I'm trying to work with a mock of NSMutableURLConnection
, but OCMock doesn't want to stub methods declared in the NSHTTPURLRequest
category of NSMutableURLConnection
.
id requestMock = OCMClassMock([NSMutableURLRequest class]);
OCMStub([requestMock setHTTPBody]);
The compiler won't accept the second line. I get "ARC Semantic Issue: No known instance method for selector 'setHTTPBody'."
The compiler allows me to stub HTTPBody
(as opposed to setHTTPBody
) but it never gets called.
Anyone know how to get a working stub and make the compiler happy in this case?