CheckOps
PBT (Ruby)
PBT is an MIT-licensed property-based testing library for Ruby with experimental parallel execution of test cases using Ractor.
Latest public signals
Not refreshed yet. Refresh reads the public site and, when the entry has a GitHub repository, the latest release.
Introduction
PBT brings property-based testing to Ruby. Instead of writing tests for predefined inputs and outputs, you specify properties your code should always satisfy, and PBT generates inputs automatically, shrinking failures to minimal counterexamples.
It includes experimental features to run test cases in parallel; results of the experiment are covered in the RubyKaigi 2024 talk “Unlocking Potential of Property Based Testing with Ractor”. Pbt.assert is the runner that executes a property, and Pbt.property describes the generated values and the check to run on them.
The source code is at ohbarye/pbt on GitHub under the MIT licence, with about 241 stars; the most recent commit was on 23 August 2026.
Launch and background: PBT was posted to Hacker News as a Show HN on 22 May 2024.
Features
- Property-based testing: Generated inputs.
- Shrinking: Minimal counterexamples.
- Arbitraries: Built-in generators.
- Experimental parallelism: Ractor-based.
Pros
- Free to use: Open source under the MIT licence, so the core tool costs nothing to use.
- Actively maintained: The repository had commits as recent as 23 August 2026.
Cons
- Small project: Single-maintainer library.
- Experimental parallelism: Not for every codebase.
Usage and Links (Example)
Pbt.assert do
Pbt.property(Pbt.array(Pbt.integer)) do |numbers|
raise unless numbers.sort == numbers.sort.sort
end
end
Resources:
Pricing
PBT (Ruby) is free and open source under the MIT licence.
Recommended for?
- Ruby developers wanting Hypothesis-style testing.
Conclusion
PBT fills a gap in Ruby’s testing toolbox.
Use it for parsers, serialisers and pure functions.
On CheckOps, PBT (Ruby) is filed under the Unit testing stage. Related tools listed here include RSpec, Minitest, Hypothesis, fast-check, proptest and Kotest. A short trial on a real project, with your own code, data and pipeline, is usually the fastest way to choose between them, because fit matters more than feature lists. Facts here come from the official site, documentation and repository, checked on 11 November 2026.
Alternatives
Other tools on CheckOps that cover similar ground. Open a page, or compare one with PBT (Ruby) side by side.
RRSpecRSpec is the MIT-licensed behaviour-driven testing framework for Ruby, made up of rspec-core, rspec-expectations and rspec-mocks, and widely used with Rails via rspec-rails.Compare with PBT (Ruby)
MMinitestMinitest is an MIT-licensed, fast and lightweight Ruby testing library providing xUnit-style tests, a spec DSL and benchmarks; it is the default testing framework in Ruby on Rails.Compare with PBT (Ruby)
HHypothesisHypothesis is the MPL-2.0 property-based testing library for Python: describe the range of inputs, let it generate cases including edge cases, and get the simplest failing example when a property breaks.Compare with PBT (Ruby)
Ffast-checkfast-check is an MIT-licensed property-based testing framework for JavaScript and TypeScript, with rich arbitraries, shrinking, replayable seeds, model-based testing and race-condition detection.Compare with PBT (Ruby)
Pproptestproptest is a Hypothesis-inspired property-based testing framework for Rust, with composable strategies, automatic shrinking and persisted regression files.Compare with PBT (Ruby)
KKotestKotest is an Apache-2.0 Kotlin multiplatform test framework with multiple testing styles, a large assertions library and built-in property-based testing.Compare with PBT (Ruby)