Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created February 6, 2014 22:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save chbatey/8853910 to your computer and use it in GitHub Desktop.
Scala: Not a good way to test asynchronous code
test("Test a asynchronous method synchronously") {
val underTest = new ClassThatReturnsFutures()
val futureResult = underTest.goDoSomething()
futureResult onComplete {
case Success(value) => value should equal("Something")
case Failure(exp) => fail(exp)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment