aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDennis Hoppe <github@debian-solutions.de>2019-12-06 15:22:49 +0100
committerDennis Hoppe <github@debian-solutions.de>2019-12-06 15:22:49 +0100
commitd4106af027780bf3573b0ff8956caf3aa9f0e9bc (patch)
tree0c3596678b81e3241bcf8878004aed3e5160a3ce /spec
parentdd8ac301ea28927fd0494d9028ff059a836080a7 (diff)
downloadpuppet-ferm-d4106af027780bf3573b0ff8956caf3aa9f0e9bc.tar.gz
puppet-ferm-d4106af027780bf3573b0ff8956caf3aa9f0e9bc.tar.bz2
modulesync 2.9.0
Diffstat (limited to 'spec')
-rw-r--r--spec/spec_helper.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 96f14d5..93f417a 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -42,6 +42,18 @@ if Dir.exist?(File.expand_path('../../lib', __FILE__))
end
RSpec.configure do |c|
+ # getting the correct facter version is tricky. We use facterdb as a source to mock facts
+ # see https://github.com/camptocamp/facterdb
+ # people might provide a specific facter version. In that case we use it.
+ # Otherwise we need to match the correct facter version to the used puppet version.
+ # as of 2019-10-31, puppet 5 ships facter 3.11 and puppet 6 ships facter 3.14
+ # https://puppet.com/docs/puppet/5.5/about_agent.html
+ c.default_facter_version = if ENV['FACTERDB_FACTS_VERSION']
+ ENV['FACTERDB_FACTS_VERSION']
+ else
+ Gem::Dependency.new('', ENV['PUPPET_VERSION']).match?('', '5') ? '3.11.0' : '3.14.0'
+ end
+
# Coverage generation
c.after(:suite) do
RSpec::Puppet::Coverage.report!