https://kotlinlang.org logo
#mockk
Title
# mockk
k

Kris Wong

04/23/2020, 2:22 PM
Copy code
mockkObject(IntentQueueFactory)
        every { IntentQueueFactory.getInstance(context) } returns queue
causes
Copy code
io.mockk.MockKException: Missing calls inside every { ... } block.
at io.mockk.impl.recording.states.StubbingState.checkMissingCalls(StubbingState.kt:14)
at io.mockk.impl.recording.states.StubbingState.recordingDone(StubbingState.kt:8)
at io.mockk.impl.recording.CommonCallRecorder.done(CommonCallRecorder.kt:47)
at io.mockk.impl.eval.RecordedBlockEvaluator.record(RecordedBlockEvaluator.kt:60)
at io.mockk.impl.eval.EveryBlockEvaluator.every(EveryBlockEvaluator.kt:30)
at io.mockk.MockKDsl.internalEvery(API.kt:92)
at io.mockk.MockKKt.every(MockK.kt:98)
changing to
refEq
for the context arg works around that issue - no idea why, but then it crashes when it tries to use the context
7 Views