mock.method(matchAll { it.size() == 2 })
mock.method(matchAll { it[1] == 0 }) // can be more flexible like this
play {
mock.method(1, 2)
mock.method(something, 0, something)
}
Not sure about the method name, and there are some other candidates:
"allMatch", "matchThat"(+1 for this one), "paramsMatch".
And I want to recall the wild card character of stubs for matching any
number of any parameters. I think "*" or "..." should be our best
choice, but something like "stub.method(*)" or "stub.method(...)" cannot
be parsed. Currently, I have got two choices:
1. stub.method(_) // I still think it doesn't look so good
2. stub.method($$) // better, but not good enough (a single "$" cannot
be parsed)
If we decide to support wild card character, I think we should use it
for stubbing instead of a pair of empty parentheses like
"stub.method().returns(0)".
Any thought?