You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// This is a protocol which uses `inout` parameter.
protocolInoutProtocol{func doSomething(inoutValue:inoutInt)}
// In test code, I want to stub mock's behavior like below. But I got error.
letmock=MockInoutProtocol()stub(mock){ mock inwhen(mock.doSomething(inoutValue:any())).then{ passedValue in
// I want to change passedValue as `inout` parameter. Like below.
passedValue =999 // error: Cannot assign to value: 'passedValue' is a 'let' constant
print(passedValue)}}
Is there a workaround? Or, am I overlooking features? I attached project file to confirm this problem. StubInout.zip
Thanks for great tool!! I love Cuckoo 😄 ❤️
The text was updated successfully, but these errors were encountered:
Hey @kainosk, yeah, this is my oversight in the tests. It didn't occur to me when writing the inout test that I should try to mutate the value, I just tried printing it to verify that the mocks are properly generated.
I've skimmed over the codebase and at the moment I can't find a way to fix this with the way things work. I'll try to discuss this with more experienced programmers, but I don't want to get your hopes up.
I want to stub
inout
parameter. Like below.Is there a workaround? Or, am I overlooking features? I attached project file to confirm this problem.
StubInout.zip
Thanks for great tool!! I love
Cuckoo
😄 ❤️The text was updated successfully, but these errors were encountered: