2

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.

Micah Hainline
  • 14,367
  • 9
  • 52
  • 85
  • 1
    I reported this a while back at http://www.mulle-kybernetik.com/forum/viewtopic.php?f=4&t=233&sid=371fd3946d71048deedae278e1e3eeaa. It doesn't seem like any progress has been made. – Christopher Pickslay Oct 28 '11 at 17:49

2 Answers2

1

Sorry only saw this now. It has been fixed for a while

https://github.com/erikdoe/ocmock/commit/db6f27041efc507ae6ab92721e2f7bbbbd14c28b

Update: The newly released version 2.0 of OCMock contains this fix. So, you don't have to build from source if you don't want to.

Erik Doernenburg
  • 2,933
  • 18
  • 21
0

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.

Claus Broch
  • 9,212
  • 2
  • 29
  • 38