Testing and Versioning
Quality and semver.
Why Test a Gem?
Because a gem is used by many projects, a bug affects everyone. Automated tests let you change code with confidence and prove the gem still works.
- Tests document expected behavior.
- They catch regressions before release.
- They are required by serious users before they adopt a gem.
Choosing a Framework
The two popular choices are Minitest (ships with Ruby, lightweight) and RSpec (rich DSL, very common). Either is fine; pick one and add it as a development dependency in the gemspec.
All lessons in this course
- Gem Structure
- Writing the Code
- Testing and Versioning
- Publishing to RubyGems