Skip to content

Commit 31fa8dc

Browse files
committed
Clarify collection conditions in docs
1 parent fdbdce7 commit 31fa8dc

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

docs/spock_primer.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,7 @@ stack.size() == 2
226226
As you can see, Spock captures all values produced during the evaluation of a condition, and presents them in an easily
227227
digestible form. Nice, isn't it?
228228

229+
[#implicit-and-explicit-conditions]
229230
===== Implicit and explicit conditions
230231

231232
Conditions are an essential ingredient of `then` blocks and `expect` blocks. Except for calls to `void` methods and

docs/utilities.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ Since Spock 2.1 you can use two new conditions:
4949
* `x =~ [1, 2, 3]` is a lenient match, i.e., checking that x contains at least one instance of every item in the list (same semantics as casting both to `Set` before comparing).
5050
* `x ==~ [1, 2, 3, 3]` is a strict match, i.e., checking that x contains exactly the items in the list regardless of their order (using Hamcrest's `containsInAnyOrder` under the hood).
5151

52+
NOTE: This is a Spock feature, not a Groovy feature. So it only works where Spock treats an expression as a <<spock_primer.adoc#implicit-and-explicit-conditions,condition>>.
53+
5254
=== Lenient Match
5355
[source,groovy,indent=0]
5456
----

0 commit comments

Comments
 (0)