How to mock class method (+)? [duplicate]
This question already has an answer here: Objective C & OC Mock - Mocking a class method? 4 answers Need to write unit testing for the following code, I want to do mock for class method canMakePayments, return yes or no, so far no good method found dues to canMakePayments is a class method (+), seems all OCMock methods are all used for instance method (-). You guys any suggestion or discussion will be appreciated. Thanks. // SKPaymentQueue.h // StoreKit if ([SKPaymentQueue canMakePayments]){ .... } else{ ... } Since you can't intercept the method by providing a different instance, what you can