I would like to know the equivalence of recoverToSucceededIf in scalatest in µtest. In fact, the github page shows the runAsync method which AFAIK is a TestRunner method.
Best regards
I would like to know the equivalence of recoverToSucceededIf in scalatest in µtest. In fact, the github page shows the runAsync method which AFAIK is a TestRunner method.
Best regards
I've currently created a trait to extend utest but it surely have a native method. I'll not mark this as an answer as this is just a workaround.
import scala.concurrent.Future
trait UTestExt {
def recoverToSucceededIf[T <: Throwable: Manifest](f: => Future[Any]): Unit = {
import scala.concurrent.ExecutionContext.Implicits.global
f.map(_ => false).recover {
case _: T => true
case _ => false
} foreach (assert(_,
manifest[T].runtimeClass.getName + " hasn't been thrown"))
}
}