Skip to content

Commit

Permalink
work with symbolized strings
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Jun 7, 2024
1 parent 09d6472 commit 1c7caff
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec-puppet-facts.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

Expand Down

0 comments on commit 1c7caff

Please sign in to comment.