I have some simple mock objects with some stubs and expectations set up. When I run my tests on the iOS 4.3 simulator, everything passes. When I run on iOS 5, I get “unexpected method invoked” failures. As an example case, I have a method - (void) foo: (NSString *) bar that I set up an expectation for and then run. The result is
unexpected method invoked: foo:@"foobar"
expected: foo:@"foobar"
Any one know why this is happening, or how to fix it? The tests themselves are perfectly fine, and have been working for months in iOS 4.
I’m using the latest version of OCMock from Github on iOS 5 without any problems. There have been some recent additions to this repository, so it’s quite possible that the problems you’re experiencing have been fixed in the latest version.