Open dekpient opened 3 years ago
Hey, @dekpient. Thanks for the PR and thanks for using the OCMock integration!
It's a nice find with the nil
, I'll take a look at the code and see what we can do with the second problem you're proposing a solution to.
Hello, I'm trying to fix 2 issues I found when trying to use
Cuckoo/OCMock
in a project. I'm currently unable to cover a few code branches because of them.mock.say(nil)
currently fails with-[_NSArrayM insertObject:atIndex:]: object cannot be nil (NSInvalidArgumentException)
becauseNSInvocation+OCMockWrapper
doesn't do a null check.objectiveArgumentClosure
and calling the closure withnil
fails with-[NSNull count]: unrecognized selector sent to instance 0x7fff8002ebb0 (NSInvalidArgumentException)
. I think it's causeTrustMe
doesn't support nullable types. I proposeobjectiveOptionalArgumentClosure
(or maybeobjcArgumentClosureWithOptional
?). I can add more of them to support closures with more args if you think this is alright.I also removed the reference to
ObjectiveExamplesTest.swift
. It doesn't exist in the project so it's making the build fail.Cheers