Skip to content

Instantly share code, notes, and snippets.

@micHar
Last active June 20, 2022 14:49
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 micHar/eeec3f6ea47825807fbfe33885e720fc to your computer and use it in GitHub Desktop.
Save micHar/eeec3f6ea47825807fbfe33885e720fc to your computer and use it in GitHub Desktop.
class MediaPlayer(...) {
...
fun dispose() {
scope.cancel()
}
}
class NeverEndingCoroutineTest {
@Test
fun `should emit error when playSound throws`() = runTest {
...
sut.playerErrors.test {
sut.play()
awaitItem() shouldBe exception
}
sut.dispose()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment