|
Re: AsyncFeatureSpec list of Assertions
|
Posted: Jan 30, 2017 7:06 PM
|
|
If you put succeed at the end, I think the test will always succeed. Succeed means succeed. So I'm not sure why you would see the test failing, but regardless I don't think it is doing what you think it is doing.
Regardless, what I'd suggest is to take your List[Future[String]] and change that to a Future[List[String]], like this:
val listOFutureChanges: List[Future[String]] = someService.doSomethingFutury(List(somethings))
val futureListOfChanges: Future[List[String]] = Future.sequence(listOfFutureChanges)
Then can map an assertion about the list of changes onto that single outer future, like this:
import org.scalatest.Inspectors._
futureListOfChanges map { changes => forAll (changes) { change => assert(change.contains("someString")) } }
|
|