Add location recording to all macros.#431
Conversation
tzvist
left a comment
There was a problem hiding this comment.
Please take my comments with a grain of salt because I am not very familiar with this code base.
| NSString *explanation = @"Did not record an invocation in OCMStub/OCMExpect/OCMReject.\n" | ||
| @"Possible causes are:\n" | ||
| @"- The receiver is not a mock object.\n" | ||
| @"- The selector conflicts with a selector implemented by OCMStubRecorder/OCMExpectationRecorder."; |
There was a problem hiding this comment.
Can you give me an outline of how that would work?
| OCMLocation *location = recorder.ocm_location; | ||
| NSString *explanation = @"Did not record an invocation in OCMStub/OCMExpect/OCMReject.\n" | ||
| @"Possible causes are:\n" | ||
| @"- The receiver is not a mock object.\n" |
There was a problem hiding this comment.
I would prefer that we would assert that the received object isKindOfClass OCMockObject in beginStubMacro/beginExpectMacro/beginRejectMacro(and this way give a much more informative message and have a proper stack trace)
There was a problem hiding this comment.
Sorry tzvist, could you clarify which received object are you talking about? If it's what I think you are saying, we don't have that info in the begin*Macro method.
There was a problem hiding this comment.
After looking at it some more I have misunderstand the way OCMock finds the class that is stubbed, apparently my proposal would not work.
| NSString *explanation = @"Did not record an invocation in OCMStub/OCMExpect/OCMReject.\n" | ||
| @"Possible causes are:\n" | ||
| @"- The receiver is not a mock object.\n" | ||
| @"- The selector conflicts with a selector implemented by OCMStubRecorder/OCMExpectationRecorder."; |
There was a problem hiding this comment.
Can you give me an outline of how that would work?
|
Removed the references to self from
|
For large CI systems it can be costly to generate debug information. Recording location data for all of the stub/expect/reject macros makes it a lot easier to record/find failures.
For large CI systems it can be costly to generate debug information.
Recording location data for all of the stub/expect/reject macros makes
it a lot easier to record/find failures.
Also renames
locationtoocm_locationto avoid conflicts with objects that we are mocking that already have a location/setLocation method.