Re:Testing Rake Tasks with RSpec
by carlosplusplus on Saturday February 01, 2014 @12:50PM
(#7162450)
Thank you, lukes386, for your comment.
I'm new to Ruby / Rails and using RSpec in general, so I really appreciate any resources people pass along. I'll be sure to check out that talk and may refactor my tests accordingly.
I personally try to move as much logic as possible into easily testable, independent methods. This leaves things like Rake tasks as very small, "obviously correct" shells around the actual logic.
I highly recommend checking out the talk Boundaries by Gary Bernhardt[0], which explains this idea far better than I can.
[0]: https://www.destroyallsoftware.com/talks/boundaries