diff --git a/Rakefile b/Rakefile index 1938812d5..912a815c3 100644 --- a/Rakefile +++ b/Rakefile @@ -33,7 +33,7 @@ namespace :coverage do SimpleCov.minimum_coverage 100 - SimpleCov.collate Dir["simplecov-resultset-*/.resultset.json"], "rails" do + SimpleCov.collate Dir["{coverage,simplecov-resultset-*}/.resultset.json"], "rails" do formatter SimpleCov::Formatter::Console end end diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 7b9f72728..279af2090 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -30,6 +30,10 @@ nav_order: 5 *Joseph Carpenter* +* Fix coverage reports overwriting each other when running locally. + + *Jonathan del Strother* + ### v3.0.0 1,000+ days and 100+ releases later, the 200+ contributors to ViewComponent are proud to ship v3.0.0! diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 2c4309696..f9e4f3206 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -2,10 +2,11 @@ require "simplecov" require "simplecov-console" +require "rails/version" if ENV["MEASURE_COVERAGE"] SimpleCov.start do - command_name "rails#{ENV["RAILS_VERSION"]}-ruby#{ENV["RUBY_VERSION"]}" if ENV["RUBY_VERSION"] + command_name "RSpec-rails#{Rails::VERSION::STRING}-ruby#{RUBY_VERSION}" formatter SimpleCov::Formatter::Console end diff --git a/test/test_helper.rb b/test/test_helper.rb index abb73a9ca..6528bdb12 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -2,10 +2,11 @@ require "simplecov" require "simplecov-console" +require "rails/version" if ENV["MEASURE_COVERAGE"] SimpleCov.start do - command_name "rails#{ENV["RAILS_VERSION"]}-ruby#{ENV["RUBY_VERSION"]}" if ENV["RUBY_VERSION"] + command_name "minitest-rails#{Rails::VERSION::STRING}-ruby#{RUBY_VERSION}" formatter SimpleCov::Formatter::Console end