Created
November 22, 2018 23:26
-
-
Save vichu/6dafcbefdc3499e30b7f89d0227a490e to your computer and use it in GitHub Desktop.
First example
This file contains 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
import org.scalatest.FlatSpec | |
import org.scalatest.concurrent.ScalaFutures | |
class NetworkCallExampleTest extends FlatSpec with ScalaFutures { | |
it should "verify the future returns when complete" in { | |
val networkCallExample = new NetworkCallExample | |
//This will fail with a time out error | |
whenReady(networkCallExample.lengthOfTheResponse("testurl")) { res => | |
assert(res == 10) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment