โ Ruby Programming learning pathRuby Programming ยท Module 10 of 10
Testing and a small Ruby project
Write tested Ruby code and ship a small command-line tool.
๐ Key ideas
- RSpec and Minitest are the two main testing tools.
- A test sets up data, runs code and checks the result with expect or assert.
- RuboCop checks style and common mistakes.
- A CLI tool can read ARGV and files, then print a report.
- 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