发布于 2016-05-10 16:39:44
只要摆脱对最严重的依赖,你就不需要那些东西了:
trait VeryUsefulTrait {
implicit class RichExpect[T](expect: Expect[T]) {
val timeout = expect.settings.timeout + 1.second
def failedFutureValue: Throwable = Await.result(expect.run().failed, timeout)
def futureValue: T = Await.result(expect.run(), timeout)
def whenReady[U](f: T => U): U = f(Await.result(expect.run(), timeout))
}https://stackoverflow.com/questions/37143475
复制相似问题