Comment

Comment by ohbarye

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
parent ohbarye 2 years ago

No comments yet

Be the first to share your thoughts.

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton