Expectation matchers failing on iOS5 simulator

Discussion of the OCMock framework. If you have patches we would prefer you to send them to the mailing list, but attaching them to a topic is possible, too.

Expectation matchers failing on iOS5 simulator

Postby chrispix » 13 Jun 2011, 20:35

Running tests with the iPad 5.0 Simulator destination set, all expectations are failing with "unexpected method invoked". The same tests run fine with the iPad 4.3 simulator in Xcode 4.2. As you can see from the output, the expectation has been set:

2011-06-13 11:33:25.839 otest[12231:5103] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'OCMockObject[UITextView]: unexpected method invoked: setText:@"foo"
stubbed: text
stubbed: selectedRange
expected: setText:@"foo"'
chrispix
 
Posts: 7
Joined: 07 May 2010, 19:32

Re: Expectation matchers failing on iOS5 simulator

Postby micahhainline » 03 Nov 2011, 23:25

I have had this same problem. I posted on http://stackoverflow.com/questions/7919410/why-do-my-ocmock-expects-and-stubs-fail-in-ios-5 but there have been no suggestions for what the problem could be or workarounds.
micahhainline
 
Posts: 2
Joined: 03 Nov 2011, 23:23

Re: Expectation matchers failing on iOS5 simulator

Postby tziem » 10 Feb 2012, 14:33

Could this be the reason: https://gist.github.com/1233018
tziem
 
Posts: 1
Joined: 10 Feb 2012, 14:28

Re: Expectation matchers failing on iOS5 simulator

Postby erik » 10 Feb 2012, 16:51

This is the reason. Sometimes objects should be considered equal even when they have a different class. OCMock used to be strict about the class (still is in the last released version). This has been fixed in the source on Github. I really, really should do a release I guess.

erik
erik
 
Posts: 71
Joined: 10 Oct 2009, 15:22
Location: Hamburg, Germany

Re: Expectation matchers failing on iOS5 simulator

Postby o2x7 » 02 Mar 2012, 19:14

I have found that doing a Reset Simulator... in the iOS simulator cleans this up.
o2x7
 


Return to OCMock



cron