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/`
This commit is contained in:
Kyrylo Silin 2019-03-08 00:50:48 +02:00
parent cb5eaab409
commit f0ec14c5c7
2 changed files with 9 additions and 7 deletions

View File

@ -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')

View File

@ -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