Skip to content

Commit

Permalink
Collect code coverage for rspec tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
plural committed Feb 7, 2025
1 parent b2a1493 commit 85c9d62
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@

config/database.yml

/coverage

# Ignore db for sqlite
cobra
cobra_test
Expand Down
3 changes: 3 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ group :development, :test do
gem 'brakeman', '~> 5.2'
gem 'bullet'
gem 'pry'
gem 'simplecov'
gem 'simplecov-cobertura'
gem 'simplecov-html'
end

group :test do
Expand Down
13 changes: 13 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ GEM
database_cleaner-core (2.0.1)
date (3.3.4)
diff-lcs (1.5.1)
docile (1.4.1)
drb (2.2.1)
dry-cli (1.1.0)
erubi (1.13.0)
Expand Down Expand Up @@ -361,6 +362,15 @@ GEM
simple_form (5.3.1)
actionpack (>= 5.2)
activemodel (>= 5.2)
simplecov (0.22.0)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-cobertura (2.1.0)
rexml
simplecov (~> 0.19)
simplecov-html (0.13.1)
simplecov_json_formatter (0.1.4)
slim (5.2.1)
temple (~> 0.10.0)
tilt (>= 2.1.0)
Expand Down Expand Up @@ -455,6 +465,9 @@ DEPENDENCIES
rubocop-rspec_rails
sassc-rails
simple_form
simplecov
simplecov-cobertura
simplecov-html
slim-rails
spring
stackprof
Expand Down
15 changes: 15 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
# frozen_string_literal: true

require 'simplecov'
require 'simplecov-cobertura'
SimpleCov.coverage_dir 'coverage/spec'
SimpleCov.enable_coverage :branch
SimpleCov.formatter = SimpleCov::Formatter::CoberturaFormatter

SimpleCov.start do
add_filter 'spec/'
add_filter 'test/'
add_group 'Controllers', 'app/controllers'
add_group 'Models', 'app/models'
add_group 'Resources', 'app/resources'
add_group 'Libraries', 'lib'
end

RSpec.configure do |config|
config.expect_with :rspec do |expectations|
expectations.include_chain_clauses_in_custom_matcher_descriptions = true
Expand Down

0 comments on commit 85c9d62

Please sign in to comment.