diff --git a/Gemfile b/Gemfile index bea88b8..392e490 100644 --- a/Gemfile +++ b/Gemfile @@ -47,3 +47,5 @@ end gem "rspec-rails", "~> 6.1" + +gem "simplecov", "~> 0.22.0" diff --git a/Gemfile.lock b/Gemfile.lock index 35424cb..b2222e8 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -88,6 +88,7 @@ GEM irb (~> 1.10) reline (>= 0.3.8) diff-lcs (1.5.1) + docile (1.4.1) drb (2.2.1) erubi (1.13.0) globalid (1.2.1) @@ -198,6 +199,12 @@ GEM rspec-mocks (~> 3.13) rspec-support (~> 3.13) rspec-support (3.13.1) + 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) stringio (3.1.1) thor (1.3.1) timeout (0.4.1) @@ -224,6 +231,7 @@ DEPENDENCIES puma (>= 5.0) rails (~> 7.1.3, >= 7.1.3.4) rspec-rails (~> 6.1) + simplecov (~> 0.22.0) tzinfo-data RUBY VERSION diff --git a/spec/rails_helper.rb b/spec/rails_helper.rb index a15455f..7ba94a2 100644 --- a/spec/rails_helper.rb +++ b/spec/rails_helper.rb @@ -3,10 +3,11 @@ ENV['RAILS_ENV'] ||= 'test' require_relative '../config/environment' # Prevent database truncation if the environment is production -abort("The Rails environment is running in production mode!") if Rails.env.production? +abort('The Rails environment is running in production mode!') if Rails.env.production? require 'rspec/rails' # Add additional requires below this line. Rails is not loaded until this point! - +require 'simplecov' +SimpleCov.start # Requires supporting ruby files with custom matchers and macros, etc, in # spec/support/ and its subdirectories. Files matching `spec/**/*_spec.rb` are # run as spec files by default. This means that files in spec/support that end