Method: PropCheck::Generators.constant
- Defined in:
- lib/prop_check/generators.rb
.constant(val) ⇒ Object
Always returns the same value, regardless of size or rng (random number generator state)
No shrinking (only considers the current single value val).
>> Generators.constant("pie").sample(5, size: 10, rng: Random.new(42))
=> ["pie", "pie", "pie", "pie", "pie"]
21 22 23 |
# File 'lib/prop_check/generators.rb', line 21 def constant(val) Generator.wrap(val) end |