diff --git a/Gemfile b/Gemfile index 11a624c2..4045d58f 100644 --- a/Gemfile +++ b/Gemfile @@ -1,5 +1,7 @@ source ENV['GEM_SOURCE'] || 'https://rubygems.org' +gem 'facterdb', git: 'https://github.com/bastelfreak/facterdb', branch: 'optional-symbolize-keys' + gemspec gem 'facter', ENV['FACTER_GEM_VERSION'], :require => false diff --git a/lib/rspec-puppet-facts.rb b/lib/rspec-puppet-facts.rb index 0f5f0cd7..36f55e62 100644 --- a/lib/rspec-puppet-facts.rb +++ b/lib/rspec-puppet-facts.rb @@ -123,7 +123,7 @@ def on_supported_os_implementation(opts = {}) # facter data (see FacterDB 0.5.2 for Facter releases 3.8 and 3.9). In this situation we need to # cycle through and downgrade Facter versions per platform type until we find matching Facter data. filter.each do |filter_spec| - versions = FacterDB.get_facts(filter_spec).to_h { |facts| [Gem::Version.new(facts[:facterversion]), facts] } + versions = FacterDB.get_facts(filter_spec, symbolize_keys: !RSpec.configuration.facterdb_string_keys).to_h { |facts| [Gem::Version.new(facts[:facterversion]), facts] } version, facts = versions.select { |v, _f| strict_requirement =~ v }.max_by { |v, _f| v }