From 2e9936ae1f5b53e443c2e81c293974e766bc60b4 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sat, 23 Mar 2024 18:20:04 +0100 Subject: [PATCH] rspec-puppet-facts: Require 3.0.0 --- lib/voxpupuli/test/facts.rb | 2 +- spec/facts_spec.rb | 6 +++--- voxpupuli-test.gemspec | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/voxpupuli/test/facts.rb b/lib/voxpupuli/test/facts.rb index ea33b6d..a8bdca9 100644 --- a/lib/voxpupuli/test/facts.rb +++ b/lib/voxpupuli/test/facts.rb @@ -51,7 +51,7 @@ def add_facts_for_metadata(metadata) metadata['dependencies'].each do |dependency| case normalize_module_name(dependency['name']) when 'camptocamp/systemd', 'puppet/systemd' - add_custom_fact :systemd, ->(_os, facts) { facts['service_provider'] == 'systemd' } + add_custom_fact :systemd, ->(_os, facts) { facts[:service_provider] == 'systemd' } when 'puppetlabs/stdlib' add_stdlib_facts end diff --git a/spec/facts_spec.rb b/spec/facts_spec.rb index 0b29bd7..8713074 100644 --- a/spec/facts_spec.rb +++ b/spec/facts_spec.rb @@ -134,7 +134,7 @@ facts = RspecPuppetFacts.with_custom_facts('redhat-7-x86_64', { os: { 'family' => 'RedHat', 'release' => { 'major' => '7' } } }) - expect(facts['systemd']).to be true + expect(facts[:systemd]).to be true end it 'has no systemd on Red Hat 6' do @@ -142,7 +142,7 @@ facts = RspecPuppetFacts.with_custom_facts('redhat-6-x86_64', { os: {'family' => 'RedHat', 'release' => { 'major' => '6' }} }) - expect(facts['systemd']).to be false + expect(facts[:systemd]).to be false end it 'has no systemd on openbsd' do @@ -150,7 +150,7 @@ facts = RspecPuppetFacts.with_custom_facts('openbsd-6.4-x86_64', { os: { 'family' => 'OpenBSD' } }) - expect(facts['systemd']).to be false + expect(facts[:systemd]).to be false end end end diff --git a/voxpupuli-test.gemspec b/voxpupuli-test.gemspec index 8825336..2122e96 100644 --- a/voxpupuli-test.gemspec +++ b/voxpupuli-test.gemspec @@ -27,7 +27,7 @@ Gem::Specification.new do |s| # 3.0.0 and later require Ruby 2.7 s.add_runtime_dependency 'puppet-strings', '~> 4.0' s.add_runtime_dependency 'rspec-puppet', '~> 4.0' - s.add_runtime_dependency 'rspec-puppet-facts', '~> 2.0', '>= 2.0.5' + s.add_runtime_dependency 'rspec-puppet-facts', '~> 3.0' s.add_runtime_dependency 'rspec-puppet-utils', '~> 3.4' # Rubocop