EarlGrey icon indicating copy to clipboard operation
EarlGrey copied to clipboard

EarlGrey 2.0 - OCMock compatibility

Open teddysantyaa opened this issue 5 years ago • 2 comments

Sorry for creating a new issue, i've been asking at other open issues but not getting any response is it possible to use OCMock or mocking objects in EarlGrey 2.0 ? i found a GREY_STUB_CLASS_IN_APP_MAIN_QUEUE macro but it doesn't seem to stub anything. Please add me to the slack channel / google group if it's preferred to discuss there Thank you 🙇‍♂️

teddysantyaa avatar Sep 30 '20 07:09 teddysantyaa

You can stub OCMock objects with GREY_REMOTE_CLASS_IN_APP as well. Have you tried it?

tirodkar avatar Oct 26 '20 20:10 tirodkar

@tirodkar i tried to use GREY_REMOTE_CLASS_IN_APP in helper bundle where i can access my class thanks to eDO but the macro returns nil so i can't mock it. i read the docs that mentioned "The class interface must be exposed to the test process for doing this." does this mean i need to build the class in my test target ?

teddysantyaa avatar Jan 11 '21 09:01 teddysantyaa