Method: PropCheck::Generators.ascii_string
- Defined in:
- lib/prop_check/generators.rb
permalink .ascii_string(**kwargs) ⇒ Object
Generates strings from the printable ASCII character set.
Shrinks towards fewer characters, and towards ‘n’.
>> Generators.ascii_string.sample(5, size: 10, rng: Random.new(42))
=> ["S|.g", "drvjjw\b\a7\"", "!w=E!_[4@k", "x", "zZI{[o"]
Accepts the same options as ‘array`
581 582 583 |
# File 'lib/prop_check/generators.rb', line 581 def ascii_string(**kwargs) array(ascii_char, **kwargs).map(&:join) end |