mockito / mockito-kotlin

Using Mockito with Kotlin
MIT License
3.11k stars 202 forks source link

Inline `whenever` to let Mockito's UnfinishedStubbing messages work #278

Closed trav closed 6 years ago

trav commented 6 years ago

When Mockito detects unfinished stubbing, it will spit out an error containing:

Unfinished stubbing detected here:
-> at com.nhaarman.mockitokotlin2.OngoingStubbingKt.whenever(OngoingStubbing.kt:42)

This is not useful in helping users track down unfinished stubbing. Instead, we inline whenever to make it read as:

Unfinished stubbing detected here:
-> at com.MyTest.testMyThing(MyTest.kt:785)
nhaarman commented 6 years ago

Nice one, thanks!