mirror of
https://github.com/meineerde/rackstash.git
synced 2025-10-17 14:01:01 +00:00
Create an lcov file for coverage instead of the automatic simplecov formatter for coveralls
This commit is contained in:
parent
80b93b1f14
commit
718e2c026a
6
Gemfile
6
Gemfile
@ -13,7 +13,11 @@ gem 'rake'
|
||||
|
||||
group :test do
|
||||
gem 'rspec', '~> 3.0'
|
||||
gem 'coveralls', '~> 0.8.20'
|
||||
|
||||
if Gem.ruby_version >= Gem::Version.new('2.4.0')
|
||||
gem 'simplecov', '~> 0.18'
|
||||
gem 'simplecov-lcov', '~> 0.8'
|
||||
end
|
||||
|
||||
gem 'rack', ENV['RACK_VERSION'] ? "~> #{ENV['RACK_VERSION']}" : nil
|
||||
end
|
||||
|
||||
@ -6,13 +6,23 @@
|
||||
# of the MIT license. See the LICENSE.txt file for details.
|
||||
|
||||
if ENV['COVERAGE'].to_s == 'true'
|
||||
if Gem.ruby_version <= Gem::Version.new('2.4.0')
|
||||
STDERR.puts "Simplecov requires Ruby 2.4, but we are currently on " \
|
||||
"#{RUBY_VERSION}. Try running the spec again without collecting " \
|
||||
"coverage details (by leaving the COVERAGE environment variable empty) " \
|
||||
"or by using a newer Ruby version."
|
||||
exit 1
|
||||
end
|
||||
|
||||
require 'simplecov'
|
||||
|
||||
if ENV['CI'] == 'true'
|
||||
require 'coveralls'
|
||||
SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[
|
||||
if ENV['CI'].to_s == 'true'
|
||||
require 'simplecov-lcov'
|
||||
|
||||
SimpleCov::Formatter::LcovFormatter.config.report_with_single_file = true
|
||||
SimpleCov.formatters = [
|
||||
SimpleCov::Formatter::HTMLFormatter,
|
||||
Coveralls::SimpleCov::Formatter
|
||||
SimpleCov::Formatter::LcovFormatter
|
||||
]
|
||||
else
|
||||
SimpleCov.formatter = SimpleCov::Formatter::HTMLFormatter
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user