Rake
Testing rake tasks
This post continues our work in Improving our rake tasks with OOP.
In this one, we will discuss how to test our rake task; the example will be very straightforward. We will invoke the rake task and expect that some classes receive the correct arguments.
Improving our rake tasks with OOP
I have been writing some rake tasks for downloading backups, accessing APIs, or automating tedious and repetitive work. Rake tasks are great, but dangerous at the same time.
We add so much code to our rake tasks that they become a source of errors. Following the principles of OOP, we can clean our rake tasks, improving our code and making them much easier to test.