Skip to content

Instantly share code, notes, and snippets.

@vichu
Created November 22, 2018 23:46
Show Gist options
  • Save vichu/ba4d6f96a6e9c50a33332f0533c50ece to your computer and use it in GitHub Desktop.
Save vichu/ba4d6f96a6e9c50a33332f0533c50ece to your computer and use it in GitHub Desktop.
class NetworkCallExampleTest extends AsyncFlatSpec {
it should "verify the future returns with for and yield" in {
val networkCallExample = new NetworkCallExample
// More fluent version
for {
_ <- networkCallExample.lengthOfTheResponse("testurl")
status <- networkCallExample.statusOfSomeOtherResponse("some other url")
} yield {
assert(status == 200)
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment