January 2024
Intermediate to advanced
718 pages
20h 15m
English
Earlier we asked you to ignore the scaffolding around our tests. Now it’s time to look at it.
You include the testing framework facilities in your unit by including minitest/autorun.
| | require "minitest/autorun" |
The minitest/autorun module includes minitest itself, which has most of the features we’ve talked about so far. It also includes an alternate minitest/spec syntax that’s more like RSpec and the minitest/mock mock object package. (We’re not going to talk about minitest/spec syntax in this book. If you want that style of syntax, we recommend actually using RSpec.) Finally, it calls Minitest.autorun, which starts the test runner. This is why our test files have been executing tests when invoked just as plain Ruby files. ...
Read now
Unlock full access