These are chat archives for etorreborre/specs2

7th
Sep 2018
Keir Lawson
@keirlawson
Sep 07 2018 08:36
I'm trying to combine the traversiable matchers with .await to no avail
      val result: Future[List[TokenAvailability]] = takeTokensSimultaneously.unsafeToFuture()

      result must contain(TokenAvailable()).await
gives
[error] /home/keir/Code/http4s/server/src/test/scala/org/http4s/server/middleware/ThrottleSpec.scala:96:51: type mismatch;
[error]  found   : org.specs2.matcher.Matcher[scala.concurrent.Future[scala.collection.GenTraversableOnce[org.http4s.server.middleware.TokenUnavailable]]]
[error]  required: org.specs2.matcher.Matcher[scala.concurrent.Future[List[org.http4s.server.middleware.TokenAvailability]]]
[error]       result must contain(TokenAvailable()).await
anyone have any ideas?
Eric Torreborre
@etorreborre
Sep 07 2018 11:59
Can you try to upcast TokenAvailable? result must contain(TokenAvailable() : TokenAvailability).await. Sometimes Scala type inference doesn’t work well with subtyping
Keir Lawson
@keirlawson
Sep 07 2018 13:21
ah that did the trick :)