I am developing a ROR app that relies on many custom Rake tasks.
What is the best way to test them?
I am developing a ROR app that relies on many custom Rake tasks.
What is the best way to test them?
Rake tasks are pretty hard to test. The easiest solution would be to move the logic into a method in an appropriate model. You can then test that and just call the method from the rake task.
This is pretty well covered in another SO question
My recommendation, repeated here in summary, is not to try testing rake tasks: extract the code to be tested to a class, model or lib function and test it there. Then jsut use rake to call the functions and manage dependencies.