Skip to content

Instantly share code, notes, and snippets.

@esilverberg
Created November 24, 2020 16:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save esilverberg/00ea871593a5e712456b0c8b3a1842a7 to your computer and use it in GitHub Desktop.
Save esilverberg/00ea871593a5e712456b0c8b3a1842a7 to your computer and use it in GitHub Desktop.
// Define the mock
single<IMatchApi> {
mockk<IMatchApi>(relaxed = true) {
every { getMatchStack() } returns Single.just(defaultMatchStack())
}
}
// inject into tests
val matchApi: IMatchApi by inject()
// For a given test, adjust behavior accordingly
matchApi.apply {
every { getMatchStack() } returns Single.just(emptyMatchStack())
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment