Size Doesn't Matter
summary
A compact replacement for test unit claims real results: a runner plus unit, specs, mocks, pride and bench shipped as a tiny gem originally ~90 lines that grows into three frameworks, with mock code around 50 lines and a pride IO pipeline at ~35 lines. Tests run randomized by default, add richer assertions and unified diffs, and bench does curve‑fitting for performance regression. Micro frameworks execute far fewer lines and start far faster than heavyweight alternatives, and the sizes measurably reduce iteration time.
AI-written summary · about
chapters (29)
- 0:00Start
- 4:21What is Minitest?
- 5:126 Parts of Minitest
- 5:33Every method starting with "test" is run in a new context.
- 6:12Test randomization prevents order dependencies.
- 6:36Verbose mode prints test times in a sortable format
- 7:03Test summary provides useful statistics
- 7:22Test Example
- 7:48Positive Assertions
- 8:18assert_equal diffs
- 9:09Negative Assertions
- 11:00refute_silent
- 12:46Specs Transform
- 14:36mock high
- 14:54mock smart
- 15:17"def is my stub framework" Phil Hagelberg
- 16:58Simple 10 Pipelining
- 17:17Implementation
- 18:29minitest/unit example
- 19:26minitest/spec example
- 19:51Curve Fitting
- 21:03minitest/spec methods
- 22:05Other Examples
- 24:56bacon: n.should be. close m, delta
- 26:44test/unit v1
- 28:09Simplified test/unit
- 28:40rspec: n.should be_close(m, d)
- 30:13Lines of Code Executed (trace = 1 test)
- 31:46Flog (Complexity) Score
related talks
01h 05mMicrotesting
21mScaling Test Automation: Building Reusability for 10x Speed and Efficiency
26mA Unit Test Would Have Caught This...
40mMeasure What Matters
31mSustainable way of testing your code
25mAdvanced Testing Concepts
46mTesting the untestable - patterns and use cases analysis
41mHow deep are your tests
