Top "Ocmock" questions

OCMock is an Objective-C implementation of mock objects.

Test target X encountered an error (Early unexpected exit, operation never finished bootstrapping - no restart will be attempted

I have started working with OCMock to write test cases for the existing project that I have integrated in my …

ios unit-testing xcode7 ocmock
How to stub a class method in OCMock?

I often find in my iPhone Objective-C unit tests that I want stub out a class method, e.g. NSUrlConnection's +…

iphone objective-c cocoa-touch ocmock
Passing primitives to an OCMock's stub

I'm learning how to use OCMock to test my iPhone's project and I have this scenario: a HeightMap class with …

xcode primitive ocmock
Testing use of NSURLConnection with HTTP response error statuses

I'm writing an iPhone application that needs to get some data from a web server. I'm using NSURLConnection to do …

iphone objective-c cocoa-touch ocmock
How can I use OCMock to verify that a method is never called?

At my day job I've been spoiled with Mockito's never() verification, which can confirm that a mock method is never …

objective-c cocoa mocking mockito ocmock
Can OCMock run a block parameter?

Assume a method signature such as the following: - (void)theMethod:(void(^)(BOOL completed))completionBlock; I would like to mock …

ios unit-testing ocmock
How can the return value of an OCMock stub be changed?

It seems that the first time I add andReturnValue on an OCMock stub, that return value is set in stone. …

unit-testing ocmock
Stub a Method That Returns a BOOL with OCMock

I'm using OCMock 1.70 and am having a problem mocking a simple method that returns a BOOL value. Here's my code: @…

cocoa unit-testing ocmock
how to unit test a NSURLConnection Delegate?

How can I unit test my NSURLConnection delegate? I made a ConnectionDelegate class which conforms to different protocols to serve …

ios unit-testing nsurlconnection ocmock nsurlconnectiondelegate
How to mock class method (+)?

Need to write unit testing for the following code, I want to do mock for class method canMakePayments, return yes …

objective-c unit-testing mocking static-methods ocmock