I just noticed this which could be the potential reason for this issue:
After reading through some documentation I get to know that OCMock versions 2.2 and later work with XCTest. I am using using 2.1 version which could be a reason for compilation errors.
Reference: XCode with XCTest and OCMock Versions