Expected nil, but was nil
pikaboo opened this issue · comments
How does this even happen?
Here is code to reproduce:
_scriptManager = OCMPartialMock([ScriptsManager manager]);
OCMStub([_scriptManager cachedData]).andReturn(nilValue());
id expected = nilValue();
id actual = [_scriptManager cachedData];
assertThat(actual, equalTo(expected));
code from the library:
- (BOOL)matches:(id)item
{
if (item == nil)
return self.expectedValue == nil;
return [item isEqual:self.expectedValue];
}
item == nil returns false
please see stackoverflow post below.
What is the question? Is there an OCMockito issue?
The question is: why is nil != nil ?
Your example shows OCMock, not OCMockito. Do you have an OCMockito question?