These are chat archives for etorreborre/specs2

16th
Nov 2016
Mika Vilpas
@sp3ctum
Nov 16 2016 10:44

hello everybody! looking for help: I'm trying to match against a Future with beLike, but I can't get my test to compile.

      3 must beLike{case 3 => ok}
      Future(true) must beLike {case x:Boolean if x == true => ok}.await

the first line compiles but the second fails.

Eric Torreborre
@etorreborre
Nov 16 2016 10:45
you need to have an implicit ExecutionEnv in scope class MySpec(implicit ee: ExecutionEnv) extends Specification
Mika Vilpas
@sp3ctum
Nov 16 2016 10:45
yes, I have this. let me paste the error message
[error] foo.scala:29: missing parameter type for expanded function
[error] The argument types of an anonymous function must be fully known. (SLS 8.5)
[error] Expected type was: PartialFunction[?,org.specs2.matcher.MatchResult[_]]
[error]       Future(true) must beLike {case true => ok}.await
Eric Torreborre
@etorreborre
Nov 16 2016 10:46
try to qualify beLike: beLike[Boolean]
Mika Vilpas
@sp3ctum
Nov 16 2016 10:46
oh looks like I changed the line a bit from the previous example, but the error is actually the same
yes, this works. wonderful! thanks @etorreborre
Eric Torreborre
@etorreborre
Nov 16 2016 10:49
you're welcome :-)