Skip to content

Commit 58afbda

Browse files
committed
Integrate simplecov with rspec
1 parent 0bc0c69 commit 58afbda

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,3 +70,5 @@ config/litestream/*.yml
7070

7171
# Ignore rspec failure file
7272
spec/failures.txt
73+
74+
/coverage

.simplecov

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
SimpleCov.start :rails do
2+
add_group "Controllers", "app/controllers"
3+
add_group "Content", "app/content"
4+
add_group "Helpers", "app/helpers"
5+
add_group "Jobs", "app/jobs"
6+
add_group "Libraries", "lib"
7+
add_group "Mailers", "app/mailers"
8+
add_group "Models", "app/models"
9+
add_group "Notifiers", "app/notifiers"
10+
add_group "Views", "app/views"
11+
12+
add_filter %r{^/bin/}
13+
add_filter %r{^/config/}
14+
add_filter %r{^/db/}
15+
add_filter %r{^/log/}
16+
add_filter %r{^/storage/}
17+
add_filter %r{^/tmp/}
18+
add_filter %r{^/vendor/}
19+
20+
add_filter %r{^/app/assets/}
21+
add_filter %r{^/app/javascript/}
22+
23+
add_filter %r{^/lib/assets/}
24+
add_filter %r{^/lib/rails-wasm/}
25+
end

spec/rails_helper.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
1+
# frozen_string_literal: true
2+
13
# This file is copied to spec/ when you run 'rails generate rspec:install'
24
require "spec_helper"
35
ENV["RAILS_ENV"] ||= "test"
6+
7+
require "simplecov"
8+
49
require_relative "../config/environment"
510
# Prevent database truncation if the environment is production
611
abort("The Rails environment is running in production mode!") if Rails.env.production?

0 commit comments

Comments
 (0)