Closed flash-gordon closed 4 years ago
This adds arguments to the random provider. These values are used to build a random generator, similar to how the timestamp provider works.
Passing the same seed produces the same results:
with_random(seed: 123) { ... }
When a proc is passed, it's used to get the next value:
with_random(proc { |prev_value = 0.0| prev_value + 0.1 }) { ... }
Both options are useful for testing random values.
This adds arguments to the random provider. These values are used to build a random generator, similar to how the timestamp provider works.
Passing the same seed produces the same results:
When a proc is passed, it's used to get the next value:
Both options are useful for testing random values.