spec/spec_helper.rb in puppet-lint-topscope-variable-check-1.0.1 vs spec/spec_helper.rb in puppet-lint-topscope-variable-check-1.1.0

- old
+ new

@@ -1,13 +1,29 @@ -require 'coveralls' -Coveralls.wear! +# frozen_string_literal: true -require 'puppet-lint' -PuppetLint::Plugins.load_spec_helper +begin + require 'simplecov' + require 'simplecov-console' + require 'codecov' +rescue LoadError +else + SimpleCov.start do + track_files 'lib/**/*.rb' -# strip left spaces from heredoc -# this emulates the behaviour of the ~ heredoc from ruby 2.3 -class String - def strip_heredoc - gsub(/^#{scan(/^\s*/).min_by(&:length)}/, '') + add_filter '/spec' + + enable_coverage :branch + + # do not track vendored files + add_filter '/vendor' + add_filter '/.vendor' end + + SimpleCov.formatters = [ + SimpleCov::Formatter::Console, + SimpleCov::Formatter::Codecov, + ] end + +require 'puppet-lint' + +PuppetLint::Plugins.load_spec_helper