}
],
"template-url": "https://github.com/puppetlabs/pdk-templates/",
- "template-ref": "1.9.0-0-g7281db5",
+ "template-ref": "heads/master-0-g615413e",
"pdk-version": "1.9.0"
-}
+}
\ No newline at end of file
+RSpec.configure do |c|
+ c.mock_with :rspec
+end
+
require 'puppetlabs_spec_helper/module_spec_helper'
require 'rspec-puppet-facts'
end
c.filter_run_excluding(bolt: true) unless ENV['GEM_BOLT']
c.after(:suite) do
+ RSpec::Puppet::Coverage.report!(0)
end
end
-RSpec.configure do |config|
- config.mock_with :rspec
+if ENV['COVERAGE'] == 'yes'
+ require 'simplecov'
+ require 'simplecov-console'
+ require 'codecov'
+
+ SimpleCov.formatters = [
+ SimpleCov::Formatter::HTMLFormatter,
+ SimpleCov::Formatter::Console,
+ SimpleCov::Formatter::Codecov,
+ ]
+ SimpleCov.start do
+ track_files 'lib/**/*.rb'
+
+ add_filter '/spec'
+
+ # do not track vendored files
+ add_filter '/vendor'
+ add_filter '/.vendor'
+
+ # do not track gitignored files
+ # this adds about 4 seconds to the coverage check
+ # this could definitely be optimized
+ add_filter do |f|
+ # system returns true if exit status is 0, which with git-check-ignore means file is ignored
+ system("git check-ignore --quiet #{f.filename}")
+ end
+ end
end
def with_debian_facts