From d4106af027780bf3573b0ff8956caf3aa9f0e9bc Mon Sep 17 00:00:00 2001 From: Dennis Hoppe Date: Fri, 6 Dec 2019 15:22:49 +0100 Subject: modulesync 2.9.0 --- spec/spec_helper.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'spec/spec_helper.rb') 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! -- cgit v1.2.3