Skip to content

Conversation

@pbochenski
Copy link

@pbochenski pbochenski commented Mar 30, 2017

with this method one can define mock for class

val someMock = mock<Object>()

and then define stubs in test

someMock.stub { on { something } doReturn somethingElse }

It is useful when some tests reuse mock object but with different stubbing

with this method one can define mock for class

val someMock = mock<Object>()

and then define stubs in test

someMock.stub {
	on { something } doReturn somethingElse
}

It is useful when some tests reuse mock object but with different stubbing
@nhaarman
Copy link
Collaborator

@nhaarman nhaarman changed the base branch from master to dev March 31, 2017 19:02
@pbochenski
Copy link
Author

please let me know if this is enough, or should I add all variants of stubbing to this.

@nhaarman
Copy link
Collaborator

nhaarman commented Apr 1, 2017

Spot on, thanks!

@nhaarman nhaarman merged commit 0b22ec3 into mockito:dev Apr 1, 2017
@nhaarman nhaarman mentioned this pull request Apr 1, 2017
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