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

dave08

06/11/2018, 12:10 PM
I don't have a reference to the object itself, so I tried this:
Copy code
mockkConstructor(File::class)
		every { anyConstructed<File>().resolve(any<String>()) } returns File("test")
		every { anyConstructed<File>().toString() } returns "test"
But got this:
Copy code
Failed matching mocking signature for
File(mockkConstructor<File>()).toString()
left matchers: [any()]
io.mockk.MockKException: Failed matching mocking signature for
File(mockkConstructor<File>()).toString()
left matchers: [any()]
@oleksiyp Am I doing this wrong?