From eb85739c9a3bd86415d48bf409d0b90da910f15e Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Sat, 14 Sep 2024 09:20:31 +0200 Subject: [PATCH] Fix code coverage --- .gitignore | 7 ++++--- spec/spec_helper.rb | 13 ++++++++++++- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index 9fc184e..01c2f01 100644 --- a/.gitignore +++ b/.gitignore @@ -1,12 +1,13 @@ +.byebug_history coverage -public doc log/* !/log/.keep -tmp/* +public +spec/examples.txt spec/output.log -.byebug_history storage/ +tmp/* # Docker docker/colore/variables.env diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index fd9c03f..0c0b9e9 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,3 +1,15 @@ +# frozen_string_literals: true + +if ENV['COVERAGE'] || ENV['CI'] + require 'simplecov' + + SimpleCov.start do + add_filter '/spec/' + + track_files 'lib/**/*.rb' + end +end + ENV['RACK_ENV'] = 'test' require 'pathname' @@ -10,7 +22,6 @@ require 'timecop' Sidekiq.logger = nil -SimpleCov.start SPEC_BASE = Pathname.new(__FILE__).realpath.parent