Testing Rake tasks is one of the most painful things I do as a Ruby developer. Even after extracting all the code out into a separate class (which helps a lot), I still want to make sure I test that the right classes got called correctly with the right arguments. I wanted the subject to be the task, where I could call invoke, check its prerequisites, etc. describe "cron:hourly" do its(:prerequisit