From f0ec14c5c71da182214e63825dfa88bf8fa98fda Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Fri, 8 Mar 2019 00:50:48 +0200 Subject: [PATCH] Configure SimpleCov properly * Update the requirement to latest version * Make sure we actually *check* code coverage. Previously, we were only checking files in `spec/`, but not we also check `lib/` --- Gemfile | 1 + spec/spec_helper.rb | 15 ++++++++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/Gemfile b/Gemfile index d2609c96..2c91fced 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,7 @@ gem 'rake', '~> 10.0' gem 'gist' gem 'yard' gem 'rspec', '~> 3.8.0' +gem 'simplecov', '~> 0.16', require: false # Rubocop supports only >=2.2.0 if Gem::Version.new(RUBY_VERSION) >= Gem::Version.new('2.2.0') diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index d01becf6..7d104bbe 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,5 +1,11 @@ -require 'bundler/setup' -Bundler.require :default, :test +if ENV['COVERAGE'] + require 'simplecov' + SimpleCov.start +end + +require 'pry' +require 'rspec' + require 'pry/testable' require 'English' @@ -7,11 +13,6 @@ Dir['./spec/support/**/*.rb'].map do |file| require file end -if ENV["COVERAGE"] - require "simplecov" - SimpleCov.start -end - class Module # False positive: https://github.com/rubocop-hq/rubocop/issues/5953 # rubocop:disable Style/AccessModifierDeclarations