From c89f97aafefc729b5367f9415c22369760532b60 Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Mon, 29 Mar 2021 21:01:35 +0300 Subject: [PATCH] DEV: Better SimpleCov configuration (#12544) It makes SimpleCov work with turbo_rspec and uses the default Rails configuration (with some changes) to groups files by their type (models, controllers, etc). --- spec/rails_helper.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index 6286218a94c..d3da629a8fc 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -2,7 +2,14 @@ if ENV['COVERAGE'] require 'simplecov' - SimpleCov.start + SimpleCov.command_name "#{SimpleCov.command_name} #{ENV['TEST_ENV_NUMBER']}" if ENV['TEST_ENV_NUMBER'] + SimpleCov.start 'rails' do + add_group 'Libraries', /^\/lib\/(?!tasks).*$/ + add_group 'Scripts', 'script' + add_group 'Serializers', 'app/serializers' + add_group 'Services', 'app/services' + add_group 'Tasks', 'lib/tasks' + end end require 'rubygems'