What _ (underscore) means in Spock tests?
_
is a wildcard, any object. See here to find how its exactly implemented and here for the docs. _
it's used for instance to check invocation of a method which argument does not matter, then it looks like:
1 * obj.method(1, _)
In this particular case it's checked if method method
on instance obj
was invoked exactly once with 1
as a first argument and anything as a second.