Created
November 22, 2018 23:46
-
-
Save vichu/ba4d6f96a6e9c50a33332f0533c50ece to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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