PropCheck
github.com
What it is
PropCheck is a Ruby library for property-based testing: it generates inputs and checks whether assertions hold across them. When a generated example fails, it tries to simplify that case into a smaller counterexample. Built-in generators cover integers, floats, strings, symbols, arrays, hashes, sets, dates, times and datetimes. A generator DSL lets developers define their own, while the API also supports mapping and binding values, alternatives and weighted frequency choices.
Before, after and around hooks provide setup and cleanup around generated examples. The README gives usage examples for RSpec, MiniTest, test-unit and vanilla Ruby, and says the library has no external dependencies. PropCheck requires Ruby 2.5.1 or later and is released under the MIT License. It is available as a free Community library. Installation can be done through a Gemfile or with `gem install prop_check`. For generated examples involving a database, the README recommends cleaning database state around each example and mentions DatabaseCleaner. Stateful property testing is described as a possible future separate add-on.
Spec sheet
- What it does
- PropCheck is a Ruby library for property-based testing that generates inputs and checks whether assertions hold across them.Read 8 Oct 2026 · github.com
- Purpose
- PropCheck is a Ruby library for property-based testing that checks assertions against generated inputs.Read 8 Oct 2026 · github.com
- License
- The project is released under the MIT License.Read 8 Oct 2026 · github.com
- Current published version
- RubyGems lists version 1.0.2, released March 14, 2025.Read 8 Oct 2026 · rubygems.org
- Custom generators
- Its generator API includes mapping, binding, choosing among alternatives, and weighted frequency selection.Read 8 Oct 2026 · github.com
- Database usage
- For generated examples that use a database, the README recommends cleaning database state around each example and mentions the DatabaseCleaner gem.Read 8 Oct 2026 · github.com
- Dependencies
- The README says PropCheck requires no external dependencies.Read 8 Oct 2026 · github.com
- Generator coverage
- Listed built-in generators cover integers, floats, strings, symbols, arrays, hashes, sets, dates, times, and datetimes.Read 8 Oct 2026 · github.com
- Generators
- It includes generators for common Ruby data types and a DSL for defining custom generators.Read 8 Oct 2026 · github.com
- Hooks
- PropCheck provides before, after, and around hooks for setup and cleanup around generated examples.Read 8 Oct 2026 · github.com
- Installation
- The README says to add `gem 'prop_check'` to a Gemfile or install it with `gem install prop_check`.Read 8 Oct 2026 · github.com
- Project status
- The README lists several items as unfinished before v1.0, including finalizing the testing DSL, configurable sample counts, and filtering generators.Read 8 Oct 2026 · github.com
- Ruby requirement
- The gem requires Ruby version 2.5.1 or later.Read 8 Oct 2026 · rubygems.org
- Shrinking
- When a generated case fails, PropCheck attempts to simplify it to a minimal counterexample.Read 8 Oct 2026 · github.com
- Stateful testing
- The README lists stateful property testing as a possible future separate add-on library.Read 8 Oct 2026 · github.com
- Support and contributions
- The README invites bug reports and pull requests on GitHub.Read 8 Oct 2026 · github.com
- Test framework integrations
- The README gives usage examples with RSpec, MiniTest, test-unit, and vanilla Ruby.Read 8 Oct 2026 · github.com
- Test hooks
- It provides hooks for setup and cleanup around generated example cases.Read 8 Oct 2026 · github.com
Plans and prices
Strong points and limits
Strong points
- Free MIT-licensed Ruby library.
- Built-in generators cover common Ruby data types.
- Shrinks failing cases toward minimal counterexamples.
- Works with RSpec, MiniTest, test-unit and vanilla Ruby.
- No external dependencies are required.
Limits
- Requires Ruby 2.5.1 or later.
- Stateful property testing is listed as a possible future add-on.
- Database examples require cleaning state around each example.
Who it suits
PropCheck suits Ruby developers who want to check assertions across generated inputs using RSpec, MiniTest, test-unit or vanilla Ruby. It is also useful when a failing generated case needs to be reduced to a smaller counterexample.
Verdict
PropCheck offers a broad generator set and failure shrinking for Ruby property-based tests. Check the Ruby requirement and database cleanup guidance before adopting it in a project.
Where Specifiction places it
- Property-Based Testing Tools#7 of 288.0