I\'m trying to add OCMock to my iOS 4 project. To test it out, I have a class Person with one method, -hello. When I run this test:
I have found that this bug is still around with Xcode 4/SDK 4.3 in April of 2011. For example, Test A passes, Test B crashes the test rig.
Test A:
- (void)testAcceptsAndVerifiesExpectedMethods
{
id mock = [OCMockObject mockForClass:[NSString class]];
[[mock expect] lowercaseString];
[mock lowercaseString];
[mock verify];
}
Test B:
- (void)testAcceptsAndVerifiesExpectedMethods
{
id mock = [OCMockObject mockForClass:[NSString class]];
[[mock expect] lowercaseString];
//[mock lowercaseString];
[mock verify];
}