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
I'm currently saving Date objects in that Storage, so my test setup is as follows:
let mock = MockKeyValueStorageProtocol()
stub(mock) { stub in
when(stub.load(any(), type: any(), completion: anyClosure(), failure: anyClosure()))
.then({
$2(Date())
})
}
However, I'm getting the following error for the when(stub... line:
Generic parameter 'T' could not be inferred
So I'm not sure if providing the type (Date) in the .then command is enough to make the when(stub... resolve the generic type? I'm also not sure, I'm using the block syntax correctly here? I'm trying to make calls to the load function return a date in the completion block.
Any help or hints would be highly appreciated!
The text was updated successfully, but these errors were encountered:
Hey guys,
I'm facing problems when setting up stubbing for the following protocol:
I'm currently saving Date objects in that Storage, so my test setup is as follows:
However, I'm getting the following error for the
when(stub...
line:So I'm not sure if providing the type (Date) in the
.then
command is enough to make thewhen(stub...
resolve the generic type? I'm also not sure, I'm using the block syntax correctly here? I'm trying to make calls to theload
function return a date in the completion block.Any help or hints would be highly appreciated!
The text was updated successfully, but these errors were encountered: