โ† Ruby Programming learning path
Ruby Programming ยท Module 10 of 10

Testing and a small Ruby project

Write tested Ruby code and ship a small command-line tool.

๐Ÿ“– Key ideas

  1. RSpec and Minitest are the two main testing tools.
  2. A test sets up data, runs code and checks the result with expect or assert.
  3. RuboCop checks style and common mistakes.
  4. A CLI tool can read ARGV and files, then print a report.
  5. Keep code in lib/, tests in spec/ or test/, and a README explaining usage.
๐Ÿ’ก Real-life example: Like a cook tasting each dish before serving: tests taste the code before users do.
RSpecBehaviour-style testing framework
MinitestTesting library bundled with Ruby
RuboCopStyle and lint checker
ARGVCommand-line arguments array