Skip to content

Commit

Permalink
Add simplecov
Browse files Browse the repository at this point in the history
It's been a while since I added/removed this here. I'm interested again
  • Loading branch information
Earlopain committed Apr 7, 2024
1 parent 05b6cd9 commit f3d008e
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,4 @@
/data
/.env
/public/build
/coverage
4 changes: 4 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,10 @@ gem "rugged"
gem "selenium-webdriver"
gem "simple_form"

group :test do
gem "simplecov", require: false
end

group :development, :test do
gem "factory_bot", require: false
gem "minitest-spec-rails", require: false
Expand Down
8 changes: 8 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ GEM
debug (1.9.1)
irb (~> 1.10)
reline (>= 0.3.8)
docile (1.4.0)
drb (2.2.0)
ruby2_keywords
erubi (1.12.0)
Expand Down Expand Up @@ -215,6 +216,12 @@ GEM
simple_form (5.3.0)
actionpack (>= 5.2)
activemodel (>= 5.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
smart_properties (1.17.0)
sorbet-runtime (0.5.11190)
stringio (3.1.0)
Expand Down Expand Up @@ -269,6 +276,7 @@ DEPENDENCIES
rugged
selenium-webdriver
simple_form
simplecov
webmock

BUNDLED WITH
Expand Down
27 changes: 27 additions & 0 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,33 @@

ENV["RAILS_ENV"] ||= "test"
ENV["MT_NO_EXPECTATIONS"] ||= "1"

require "simplecov"
module SimpleCov
class SourceFile
def coverage_exceeding_source_warn
# no-op, https://github.com/simplecov-ruby/simplecov/issues/1057
end
end
end

SimpleCov.start "rails" do
enable_coverage :branch
enable_coverage_for_eval

groups.delete "Channels"
groups.delete "Mailers"
groups.delete "Libraries"

add_group "Sites", "app/logical/sites"
add_group "Scraper", "app/logical/scraper"
add_group "Views", "app/views"
add_group "Logical" do |src_file|
not_filtered_further = ["logical/sites", "logical/scraper"].none? { |e| src_file.filename.include? e }
not_filtered_further && src_file.filename.include?("app/logical")
end
end

require_relative "../config/environment"
require "rails/test_help"
require "minitest-spec-rails"
Expand Down

0 comments on commit f3d008e

Please sign in to comment.