Sadly it looks like you'd have to extend OCMock in order to accomplish this. You could follow this pattern...
OCMArg.h
// Add this:
+ (CGSize)anyCGSize;
OCMArg.c
// Add this:
+ (CGSize)anyCGSize
{
return CGSizeMake(0.1245, 5.6789);
}
// Edit this method:
+ (id)resolveSpecialValues:(NSValue *)value
{
const char *type = [value objCType];
// Add this:
if(type[0] == '{')
{
NSString *typeString = [[[NSString alloc] initWithCString:type encoding:NSUTF8StringEncoding] autorelease];
if ([typeString rangeOfString:@"CGSize"].location != NSNotFound)
{
CGSize size = [value CGSizeValue];
if (CGSizeEqualToSize(size, CGSizeMake(0.1245, 5.6789)))
{
return [OCMArg any];
}
}
}
// Existing code stays the same...
if(type[0] == '^')
{
void *pointer = [value pointerValue];
if(pointer == (void *)0x01234567)
return [OCMArg any];
if((pointer != NULL) && (object_getClass((id)pointer) == [OCMPassByRefSetter class]))
return (id)pointer;
}
return value;
}