In one of the Spock tests I see a strange condition in then block:
0 * someInstance._
What does it mean?
_
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With