У меня есть rake-файл с тремя задачами, которые мне нужно выполнить по порядку.
require 'rake/testtask'
file 'some_binary_file.elf' do
puts 'fetching file from server ...'
# this task connects to a server and downloads some binaries
# it takes a few seconds to run
end
task flash_application: 'some_binary_file.elf' do
puts 'flashing the file to the hardware ...'
# this task copies a binary file to the flash memory
# of some external hardware, also takes a few seconds
end
Rake::TestTask(:hardware) do |t|
puts 'running tests ...'
f.test_files = FileList['test/**/*_test.rb']
end
rake default: [:flash_application, :hardware]
когда я запускаю $ rake
в терминале, он выдает следующий вывод.
running tests ... < ---- (not actually running)
fetching file from server ...
flashing the file to the hardware ...
Я бы ожидал, что rake будет запускать задачи в указанном мной порядке, но, похоже, сначала всегда выполняется тестовая задача. Примечательно, что тесты не запускаются, но результат создания задачи все равно выдается.