I am trying to test an rke task with rspec, and for this I need to call it twice, but it is called only once.
it 'first test' do Rake::Task['my_rake_task'].invoke # rake task was processed end it 'second test' do Rake::Task['my_rake_task'].invoke # rake task was NOT processed end
if the rake call has already been called as soon as it is not started again, unless you call:
@rake[@task_name].reenable
or call it using
@rake[@task_name].execute