I am testing the interaction between one object, and another object with some methods that have call-by-name arguments. However, I can't figure out how to create an argument matcher for that call-by-name argument.
Let's say that this is the signature of the mocked object:
def fn(arg1: => String, arg2: Int): Any
Then what I really want to do is test if that method is called with a known second argument. I don't even care all that much about the first argument, but having a way to properly test that as well would be a bonus.
This doesn't work:
there was one(mock) fn(any[()=>String], eq(12))
nor this:
there was one(mock) fn(any[Function0[String]], eq(12))
and this doesn't even compile:
there was one(mock) fn(any[=>String], eq(12))
... which obviously is to be expected.