fix fake awaitTx
This commit is contained in:
parent
8b47bf004e
commit
d759f26db6
|
@ -39,8 +39,8 @@ internal class FakeMonarchy {
|
||||||
mockkStatic("org.matrix.android.sdk.internal.util.MonarchyKt")
|
mockkStatic("org.matrix.android.sdk.internal.util.MonarchyKt")
|
||||||
coEvery {
|
coEvery {
|
||||||
instance.awaitTransaction(any<(Realm) -> Any>())
|
instance.awaitTransaction(any<(Realm) -> Any>())
|
||||||
} coAnswers {
|
} answers {
|
||||||
secondArg<suspend (Realm) -> Any>().invoke(fakeRealm.instance)
|
secondArg<(Realm) -> Any>().invoke(fakeRealm.instance)
|
||||||
}
|
}
|
||||||
coEvery {
|
coEvery {
|
||||||
instance.doWithRealm(any())
|
instance.doWithRealm(any())
|
||||||
|
|
|
@ -34,8 +34,8 @@ internal class FakeRealmConfiguration {
|
||||||
|
|
||||||
fun <T> givenAwaitTransaction(realm: Realm) {
|
fun <T> givenAwaitTransaction(realm: Realm) {
|
||||||
val transaction = slot<(Realm) -> T>()
|
val transaction = slot<(Realm) -> T>()
|
||||||
coEvery { awaitTransaction(instance, capture(transaction)) } coAnswers {
|
coEvery { awaitTransaction(instance, capture(transaction)) } answers {
|
||||||
secondArg<suspend (Realm) -> T>().invoke(realm)
|
secondArg<(Realm) -> T>().invoke(realm)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue