0

I am using Mockery lib for mocking in my Kotlin Multiplatform project. Even though I am using a mock instance; I am getting the error:

Each 'every' block requires single mock call! dev.mokkery.internal.NotSingleCallInEveryBlockException:

Code

class MyTest {

    private lateinit var clock: Clock


    @BeforeTest
    fun setup() {
        clock = mock()
    }

  @Test
    fun `test`() = runTest {
        val initialTime = Clock.System.now()
        every { clock.now() } returns initialTime
        assertEquals(clock.now(), initialTime)
    }
}


0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.