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

Allow to pass a predicate block keyword arguments with destruction #22

Closed ohbarye closed 5 months ago

ohbarye commented 5 months ago

Change

So far, Pbt doesn't allow to pass a Hash argument with destructuring.

Pbt.assert do
  Pbt.property(x: Pbt.integer, y: Pbt.char) do |h|
    # Receive the arg as a Hash so far.
  end
end

This pull request allows users to write code like below.

Pbt.assert do
  Pbt.property(x: Pbt.integer, y: Pbt.char) do |x:, y:|

  end
end

Note

However... If worker is :ractor, it still doesn't allow due to Ractor's limitation.