Skip to content

Instantly share code, notes, and snippets.

@chbatey
Created February 6, 2014 22:40
Show Gist options
  • Select an option

  • Save chbatey/8853955 to your computer and use it in GitHub Desktop.

Select an option

Save chbatey/8853955 to your computer and use it in GitHub Desktop.
ScalaTest: Using whenReady to test Futures
test("Test a asynchronous method synchronously - whenReady") {
val underTest = new ClassThatReturnsFutures()
val futureResult = underTest.goDoSomething()
whenReady(futureResult) { result =>
result should equal("The result")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment