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

Posted by wojtek Fri, 05 Jun 2009 12:55:00 GMT




Comments

Leave a response

  1. Przemyslaw Wroblewski 25 days later:

    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|

    t.name =~ (/set_proper_output_directory_for_(.*)/); test_type=$1
    RcovTestSettings.output_dir = File.expand_path("./coverage/#{test_type}")
    

    end task test_task.to_sym => task_name end

Leave a comment