You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please answer the following questions for yourself before submitting an issue.
I am running the latest version
I checked the documentation and found no answer
I checked to make sure that this issue has not already been filed (Kinda? There are similar issues but none specifically for this one)
Expected Behavior
The property speed is correctly mocked:
classTeam {
privatevar speed =0
}
val mock = spyk(Team(), recordPrivateCalls =true)
every { mock getProperty "speed" } returns 33
Current Behavior
An exception is thrown.
Steps to Reproduce
Merely this code example similar to the one from the docs fails:
classTeam {
privatevar speed =0
}
val mock = spyk(Team(), recordPrivateCalls =true)
every { mock getProperty "speed" } returns 33
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
MockK version: 1.13.10
OS: Windows
Kotlin version: 1.9.22
JDK version: 11
Type of test: Unit test
Failure Logs
Please include any relevant log snippets or files here.
Stack trace
io.mockk.MockKException: Missing mocked calls inside every { ... } block: make sure the object inside the block is a mock
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:63)
at io.mockk.impl.eval.EveryBlockEvaluator.every(EveryBlockEvaluator.kt:30)
at io.mockk.MockKDsl.internalEvery(API.kt:94)
at io.mockk.MockKKt.every(MockK.kt:143)
Minimal reproducible code (the gist of this issue)
Prerequisites
Please answer the following questions for yourself before submitting an issue.
Expected Behavior
The property
speed
is correctly mocked:Current Behavior
An exception is thrown.
Steps to Reproduce
Merely this code example similar to the one from the docs fails:
Context
Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.
Failure Logs
Please include any relevant log snippets or files here.
Stack trace
Minimal reproducible code (the gist of this issue)
The text was updated successfully, but these errors were encountered: