Method: PropCheck::Generators.alphanumeric_string

Defined in:
lib/prop_check/generators.rb

.alphanumeric_string(**kwargs) ⇒ Object

Generates a string containing only the characters a..z, A..Z, 0..9

Shrinks towards fewer characters, and towards lowercase ‘a’.

>> Generators.alphanumeric_string.sample(5, size: 10, rng: Random.new(42))
=> ["ZCoQ", "8uM", "wkkx0JNx", "v0bxRDLb", "Gl5v8RyWA6"]

Accepts the same options as ‘array`

[View source] [View on GitHub]

512
513
514
# File 'lib/prop_check/generators.rb', line 512

def alphanumeric_string(**kwargs)
  array(alphanumeric_char, **kwargs).map(&:join)
end