Skip to content

Commit

Permalink
Explicit documentation on Code argument constraints return type
Browse files Browse the repository at this point in the history
  • Loading branch information
geoand authored and leonard84 committed Dec 11, 2017
1 parent 1fb3fba commit dde7973
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions docs/interaction_based_testing.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -202,8 +202,11 @@ The argument constraints of an interaction describe which method arguments are e
1 * subscriber.receive(*_) // any argument list (including the empty argument list)
1 * subscriber.receive(!null) // any non-null argument
1 * subscriber.receive(_ as String) // any non-null argument that is-a String
1 * subscriber.receive({ it.size() > 3 }) // an argument that satisfies the given predicate
// (here: message length is greater than 3)
1 * subscriber.receive({ it.size() > 3 && it.contains('a') })
// an argument that satisfies the given predicate, meaning that
// code argument constraints need to return true of false
// depending on whether they match or not
// (here: message length is greater than 3 and contains the character a)
1 * subscriber.receive(endsWith("lo")) // Hamcrest Matchers are also supported
// (here: a string ending with 'lo')
----
Expand Down

0 comments on commit dde7973

Please sign in to comment.