A common pattern in our tests is to create a mock that returns itself from alloc/init in production code. The problem is that the mock object implements init which can't be stubbed, so calling init from production code resets state including stubs and expectations. The fix is to simply prevent resetting mock state when init is called multiple times.
A common pattern in our tests is to create a mock that returns itself from alloc/init in production code. The problem is that the mock object implements init which can't be stubbed, so calling init from production code resets state including stubs and expectations. The fix is to simply prevent resetting mock state when init is called multiple times.