From a60d82c70ddf6b853f1c2cb7b4df3d65fe1a02ee Mon Sep 17 00:00:00 2001 From: Jeremy Daer Date: Sun, 4 Mar 2018 22:21:02 -0800 Subject: [PATCH] Code coverage: only cover library code Ignore embedded Rails apps and the specs themselves. --- spec/spec_helper.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 47fad70..d2526de 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,7 +3,12 @@ if ENV['CI'] && RUBY_ENGINE != 'rbx' # coverage is extremely slow on Rubinius require 'simplecov' - SimpleCov.start + SimpleCov.start do + # Only cover lib/. Omit spec/railsapps. + add_filter do |src| + src.filename !~ %r{/lib/roadie/rails} + end + end require 'codecov' SimpleCov.formatter = SimpleCov::Formatter::Codecov