I have an object
object Foo {
fun doSomething(param: String) {
throw Exception()
}
}
I want it to become a stub (relaxed mock in mockk terminology) in my test.
Other words, I want this test to pass without exception:
@Test
fun shouldAskFooWithCorrectParams() {
mockkObject(Foo) // How to change it to make Foo a stub
Foo.doSomething("hey!")
verify(exactly = 1) { Foo.doSomething("hey!") }
}