ocmock
ocmock copied to clipboard
Mock objects that implement several protocols
First of all OCMock is a great tool, thank you for all the hard work on it!
OCMock doesn't provide a way to create a mock object that implements several protocols. I believe that this would be a useful addition.
What do you think?
Agreed. Now I need to find the time to implement it...
For the time being you can use this workaround: in your test file, you can create a new protocol that implements the multiple ones you need:
@protocol MyTestProtocol <MyProtocolA, MyProtocolB>
@end
and then mock it:
id protocolMock = OCMProtocolMock(@protocol(MyTestProtocol));