I'm guessing this has to do with Rake reading the file once and not rewinding it? But, I'm not sure. Any ideas?
require 'rake'
require 'rails_helper'
describe 'MyRakeTask' do
  before(:all) do
    Rails.application.load_tasks
  end
  it 'does something sweet' do
    Rake::Task["namespace:my_task"].invoke # runs task
  end
  it 'but it doesnt do it again' do
    Rake::Task["namespace:my_task"].invoke # returns nil
  end
end
 
     
    