Can I override task :environment in test_helper.rb to test rake tasks?
My "solution" to a similar problem was to extract all the logic from my .rake files and create classes to perform the tasks, leaving just a one-line call in the rake file, which I felt confident in not testing too hard. The classes could then be tested pretty much normally.
I don't know how well this would stand up to a complex set of interdependent tasks that maintain some far-reaching state: probably not well, but then again that would most likely be an indication of some other design problem...
I'm curious to see if I've missed something better.
EDIT: There used to be a blog post here that (a) says the same thing and (b) says it better. Looks like he said it first, too.