Minitest v1.0.0 on ruby 3.4 | zenspider.com | by ryan davis
14-Nov-2025 516
The last post showed how minitest was originally written. That must have been back on ruby 1.7 or 1.8? If I were to write it today, it would probably look more like the code below.
Some things to pay attention to:
56 lines instead of 99!
Cleaner test discovery. No more ObjectSpace.each_object!
Better division of responsibilities. Look at autotest on both.
Start with randomization and do it ACROSS all tests (not across classes, and then across their methods)
A massive switch to endless methods.
More attention paid to code formatting to help with visual pattern matching.
Some tricks learned along the way to speed things up (eg using lambdas for the failure message to delay string evaluation).
This thing is a screamer. It is so fast compared to minitest 5.
I’m not fond of the wide lines. But I’ll take 160 lines with everything in a tight little pattern matchable group. Trade offs.
Minitest v1.0.0 on ruby 3.4 | zenspider.com | by ryan davis #ruby #rubydeveloper #rubyonrails #Minitest #v1.0.0 #zenspider.com #davis #minitest https://www.rubyonrails.ba/link/minitest-v1-0-0-on-ruby-3-4-zenspider-com-by-ryan-davis