Created
February 6, 2014 22:36
-
-
Save chbatey/8853910 to your computer and use it in GitHub Desktop.
Scala: Not a good way to test asynchronous code
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
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