rconv rails rake task test:test:rcov overwrites its output
Problem:
rake test:test:rcov
overwrites its output.
Semi-solution that I use: add to Rakefile
namespace :rcov do
TESTS_DIR = 'test'
Rcov::RcovTask.new(:all) do |rcov|
rcov.pattern = FileList["#{TESTS_DIR}/**/*test*.rb"]
rcov.output_dir = 'coverage'
rcov.verbose = true
rcov.rcov_opts << "--sort coverage"
end
end
Then use the task:
rake rcov:all
your solution does not work in my project out of the box, but I’ve added another rake task to fix output directory in rcov_rails so each test type won’t overwrite previous contents:
for test_task in %w(test:units test:functionals test:integration) task_name = “rcov:set_proper_output_directory_for_#{test_task.gsub(/(test:)/,”)}”.to_sym task task_name do |t, args|
end task test_task.to_sym => task_name end