Hi Thomas,
def functionCall[A, B](in: A, out: B) = be_==(out) ^^ { (f: Function1[A, B]) => f(in) }
That's really a neat idea. We could start to generalize it:
def functionCall[A, B, C](a: A, b: B, c: C) = be_==(c) ^^ { (f: Function2[A, B, C]) => f(a, b) }
and so on.
But I suspect that the next step will be you wanting to write:
there was one(m).action(be_==(10), functionCall(10, be_>(5)))
so we need:
def functionCall[A, B](in: A, out: Matcher[B]): Matcher[Function1[A, B]] = out ^^ { (f: Function1[A, B]) => f(in) }
and then:
def functionCall[A, B](in: A, out: B): Matcher[Function1[A, B]] = functionCall(in, be_==(out))
Please play a bit with that and tell me what works and what doesn't (there might be variance issues in the general case I suspect).
Eric.