Thinking about tests: assertions and matchers
Summary
This article explores the concept of test assertions and matchers, tracing the history from xUnit-style assertions to behavior-driven development and RSpec. It argues for readable, expressive tests and shows how separate matcher objects enable composable checks, with examples across Ruby, Go, JavaScript, Python, and more. It also discusses designing custom matchers and the impact of AI-assisted coding on testing practice.