ohbarye / pbt

Property-Based Testing tool for Ruby, supporting multiple concurrency methods (Ractor, multiprocesses, multithreads).
https://rubygems.org/gems/pbt
MIT License
207 stars 4 forks source link

Add array generator #1

Closed ohbarye closed 7 months ago

ohbarye commented 7 months ago

Changes

This adds an array generator that takes one generator of any element.

Pbt.forall(Pbt::Generator.array(Pbt::Generator.integer, min: 0, max: 10, empty: true)) do |numbers|
  raise if numbers.size > 2
end