HTTPResult *successResult = [[HTTPResult alloc] init];
successResult.success = YES;
successResult.content = @{@"key":@"value"};
id httpMock = OCMClassMock([HTTPUtility class]);
OCMStub(ClassMethod([httpMock requestWithHTTPMethod:HTTPRequestMethodGet
URLString:@"testURL"
parameters:[OCMArg any]
response:[OCMArg any]])).andDo(^(NSInvocation *invocation) {
void(^response)(HTTPResult *) = nil;
[invocation getArgument:&response atIndex:5];
response(successResult);
});
this throw EXC_BAD_ACCESS in the[OCMockObject dealloc]method and crash when the class method is invoked
what's the right way to test a class method with a specific block