Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock objects that implement several protocols #178

Open
schmittsfn opened this issue Feb 16, 2015 · 2 comments
Open

Mock objects that implement several protocols #178

schmittsfn opened this issue Feb 16, 2015 · 2 comments

Comments

@schmittsfn
Copy link

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?

@erikdoe
Copy link
Owner

erikdoe commented Feb 16, 2015

Agreed. Now I need to find the time to implement it...

@tinsukE
Copy link

tinsukE commented Jun 10, 2015

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));

mattrobmattrob added a commit to mattrobmattrob/ocmock that referenced this issue May 5, 2016
- Remove warnings in `OCMockObjectRuntimeTests.m`
- Add tests in `OCMockObjectProtocolMocksTests.m` to test new multiple protocol mock
- Add new macros to create multi-Protocol mocks

Completes erikdoe#178 enhancement.
mattrobmattrob added a commit to mattrobmattrob/ocmock that referenced this issue May 5, 2016
- Remove warnings in `OCMockObjectRuntimeTests.m`
- Add tests in `OCMockObjectProtocolMocksTests.m` to test new multiple protocol mock
- Add new macros to create multi-Protocol mocks

Completes erikdoe#178.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants