News for hackers. Stuff that matters.
Re:Show HN: PBT – A property-based testing library for Ruby by ohbarye on Thursday May 23, 2024 @09:11AM (#40454261)
Yeah, the easiest way is to generate attributes and instantiate any Rails model like the one below:

    Pbt.assert do
      Pbt.property(name: Pbt.printable_string, age: Pbt.integer(min: 0, max: 100)) do |name:, age:|
        user = User.new(name: name, age: age)
        # write your test here
      end
    end

There are no comments on this comment yet.