erikdoe/ocmock — pull request #40 by LowAmmo (2013-07-26 17:57:57+00:00)
Title: Added support for mocking functions that return structs.

Implementing ideas referenced:

http://stackoverflow.com/questions/16559191/returning-cgrect-from-mocked-method-crashes
http://codeforfun.wordpress.com/2009/02/07/ocmock-return-a-struct/

Instead of lots of people doing "one-off's" that add this support, figured returning structs could pretty easily be a first-level feature.

Example of how it can be used:

OCMockObject* mockString = [OCMockObject partialMockForObject:string];
[[[mockString stub] andReturnStruct:&range objCType:@encode(NSRange)] rangeOfString:OCMOCK_ANY];