Skip to content

Commit

Permalink
Add SimpleCov
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesdeb committed Apr 10, 2020
1 parent f008dc6 commit 78334e4
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 5 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
# application specific
database.yml
examples.txt
coverage

/public/packs
/public/packs-test
Expand Down
12 changes: 9 additions & 3 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# frozen_string_literal: true

source 'https://rubygems.org'
git_source(:github) { |repo| "https://github.com/#{repo}.git" }

Expand Down Expand Up @@ -33,16 +35,20 @@ gem 'jquery-rails'

group :development, :test do
# Call 'byebug' anywhere in the code to stop execution and get a debugger console
gem 'byebug', platforms: [:mri, :mingw, :x64_mingw]
gem 'byebug', platforms: %i[mri mingw x64_mingw]
gem 'factory_bot_rails'
gem 'rspec-rails'
gem 'shoulda-matchers'
gem 'factory_bot_rails'
end

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

group :development do
# Access an interactive console on exception pages or by calling 'console' anywhere in the code.
gem 'web-console', '>= 3.3.0'
gem 'listen', '>= 3.0.5', '< 3.2'
gem 'web-console', '>= 3.3.0'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
gem 'spring-watcher-listen', '~> 2.0.0'
Expand Down
6 changes: 6 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ GEM
concurrent-ruby (1.1.6)
crass (1.0.6)
diff-lcs (1.3)
docile (1.3.2)
erubi (1.9.0)
execjs (2.7.0)
factory_bot (5.1.2)
Expand Down Expand Up @@ -177,6 +178,10 @@ GEM
tilt
shoulda-matchers (4.3.0)
activesupport (>= 4.2.0)
simplecov (0.18.5)
docile (~> 1.1)
simplecov-html (~> 0.11)
simplecov-html (0.12.2)
spring (2.1.0)
spring-watcher-listen (2.0.1)
listen (>= 2.7, < 4.0)
Expand Down Expand Up @@ -227,6 +232,7 @@ DEPENDENCIES
rspec-rails
sass-rails (>= 6)
shoulda-matchers
simplecov
spring
spring-watcher-listen (~> 2.0.0)
turbolinks (~> 5)
Expand Down
12 changes: 10 additions & 2 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# frozen_string_literal: true

# This file is copied to spec/ when you run 'rails generate rspec:install'

require 'simplecov'
SimpleCov.start 'rails'

require 'spec_helper'
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../config/environment', __dir__)
# Prevent database truncation if the environment is production
abort('The Rails environment is running in production mode!') if Rails.env.production?
if Rails.env.production?
abort('The Rails environment is running in production mode!')
end
require 'rspec/rails'
# Add additional requires below this line. Rails is not loaded until this point!
require 'support/factory_bot'
Expand Down Expand Up @@ -69,4 +77,4 @@
with.test_framework :rspec
with.library :rails
end
end
end

0 comments on commit 78334e4

Please sign in to comment.