0Pricing
Ruby Academy · Lesson

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

  1. Gem Structure
  2. Writing the Code
  3. Testing and Versioning
  4. Publishing to RubyGems
← Back to Ruby Academy