Skip to content

Added stub extension function#158

Merged
nhaarman merged 2 commits into
mockito:devfrom
pbochenski:master
Apr 1, 2017
Merged

Added stub extension function#158
nhaarman merged 2 commits into
mockito:devfrom
pbochenski:master

Conversation

@pbochenski

@pbochenski pbochenski commented Mar 30, 2017

Copy link
Copy Markdown

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
Copy Markdown
Contributor

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

Copy link
Copy Markdown
Author

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

@nhaarman

nhaarman commented Apr 1, 2017

Copy link
Copy Markdown
Contributor

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