-
Notifications
You must be signed in to change notification settings - Fork 60
Open
Description
Hi,
I am using jruby-1.6.1 with rcov (0.9.9 java) to run coverage report for my cucumber features and rspec tests. Everything works fine except it's not aggregating the data in the report. And there's no errors.
All the tests pass. And It's not aggregating the data as I can tell by seeing the controller get higher coverage with cucumber but later get dropped in the final report.
Here's the code. Please help.
desc 'Measures Cucumber features coverage using rcov'
Cucumber::Rake::Task.new(:cucumber) do |t|
t.rcov = true
t.rcov_opts = %w{--aggregate report/coverage.data --text-report --rails}
t.rcov_opts << "-o report/coverage-cucumber-#{Time.now.strftime("%d_%m_%Y_%I_%M_%p")}"
end
desc 'Measures Rspec coverage using rcov'
Spec::Rake::SpecTask.new(:rspec) do |t|
t.spec_files = FileList['spec/**/*_spec.rb']
t.rcov = true
t.rcov_opts = %w{--aggregate report/coverage.data --text-report --rails}
t.rcov_dir = "report/coverage-rspec-#{Time.now.strftime("%d_%m_%Y_%I_%M_%p")}"
end
desc "Run unit tests, specs and features to generate aggregated coverage"
task :all do |t|
rm "report/coverage.data" if File.exist?("report/coverage.data")
Rake::Task["rcov:cucumber"].invoke
Rake::Task["rcov:rspec"].invoke
end