Skip to content

Commit

Permalink
minor edit to doc
Browse files Browse the repository at this point in the history
  • Loading branch information
ptrthomas committed Jun 26, 2017
1 parent cf0d3a5 commit 261b2e2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Expand Up @@ -1269,13 +1269,13 @@ And functions work as well ! You can imagine how you could evolve a nice set of
* match date == { month: '#? isValidMonth(_)' }
```

Especially since strings can be easily coerced to numbers (and vice-versa) in Javascript, you can combine built-in validators with the self-valildation 'predicate' form as follows:
Especially since strings can be easily coerced to numbers (and vice-versa) in Javascript, you can combine built-in validators with the self-valildation 'predicate' form like this: `'#number? _ > 0'`
```cucumber
# given this invalid input (string instead of number)
* def date = { month: '3' }
# this will pass
* match date == { month: '#? _ > 0' }
# but this won't
# but this 'combined form' will fail, which is what we want
# * match date == { month: '#number? _ > 0' }
```
Expand Down

0 comments on commit 261b2e2

Please sign in to comment.