diff --git a/config_defaults.yml b/config_defaults.yml index def16a6a..616e158e 100644 --- a/config_defaults.yml +++ b/config_defaults.yml @@ -509,6 +509,8 @@ Gemfile: - gem: racc version: '~> 1.4.0' condition: "Gem::Requirement.create(['>= 2.7.0', '< 3.0.0']).satisfied_by?(Gem::Version.new(RUBY_VERSION.dup))" + - gem: deep_merge + version: '~> 1.0' - gem: 'voxpupuli-puppet-lint-plugins' version: '~> 5.0' - gem: 'facterdb' @@ -516,7 +518,7 @@ Gemfile: - gem: 'metadata-json-lint' version: '~> 4.0' - gem: 'rspec-puppet-facts' - version: '~> 2.0' + version: '~> 3.0' - gem: 'dependency_checker' version: '~> 1.0.0' - gem: 'parallel_tests' diff --git a/moduleroot/spec/spec_helper.rb.erb b/moduleroot/spec/spec_helper.rb.erb index 2d9a8673..2d9e79f3 100644 --- a/moduleroot/spec/spec_helper.rb.erb +++ b/moduleroot/spec/spec_helper.rb.erb @@ -27,7 +27,8 @@ default_fact_files.each do |f| next unless File.exist?(f) && File.readable?(f) && File.size?(f) begin - default_facts.merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) + require 'deep_merge' + default_facts.deep_merge!(YAML.safe_load(File.read(f), permitted_classes: [], permitted_symbols: [], aliases: true)) rescue StandardError => e RSpec.configuration.reporter.message "WARNING: Unable to load #{f}: #{e}" end @@ -35,7 +36,7 @@ end # read default_facts and merge them over what is provided by facterdb default_facts.each do |fact, value| - add_custom_fact fact, value + add_custom_fact fact, value, merge_facts: true end RSpec.configure do |c|