Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Aug 25, 2018
Merged

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

merged 1 commit into from
Aug 25, 2018

Conversation

trav
Copy link
Contributor

@trav trav commented Aug 22, 2018

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)

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.me.MyTest.testMyThing(MyTest.kt:785)
```
@nhaarman
Copy link
Collaborator

Nice one, thanks!

@nhaarman nhaarman merged commit a0f7875 into mockito:2.x Aug 25, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants