From fb953023c35c0b51d4f25b9664d95bd7e058a93f Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Sun, 4 Aug 2024 12:41:17 +0200 Subject: [PATCH] modulesync 9.1.0 --- .pmtignore | 1 + spec/spec_helper.rb | 20 +++++++------------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/.pmtignore b/.pmtignore index 10b98306..a9d37aa0 100644 --- a/.pmtignore +++ b/.pmtignore @@ -20,6 +20,7 @@ /.github/ /.librarian/ /Puppetfile.lock +/Puppetfile *.iml /.editorconfig /.fixtures.yml diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index b12ae2f2..58c9b66a 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -3,28 +3,22 @@ # Managed by modulesync - DO NOT EDIT # https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ -RSpec.configure do |c| - c.before do - # select the systemd service provider even when on docker - # https://tickets.puppetlabs.com/browse/PUP-11167 - if defined?(facts) && %w[Archlinux RedHat].include?(facts[:os]['family']) - allow(Puppet::FileSystem).to receive(:exist?).and_call_original - allow(Puppet::FileSystem).to receive(:exist?).with('/proc/1/comm').and_return(true) - allow(Puppet::FileSystem).to receive(:read).and_call_original - allow(Puppet::FileSystem).to receive(:read).with('/proc/1/comm').and_return(['systemd']) - end - end -end - # puppetlabs_spec_helper will set up coverage if the env variable is set. # We want to do this if lib exists and it hasn't been explicitly set. ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__)) require 'voxpupuli/test/spec_helper' +RSpec.configure do |c| + c.facterdb_string_keys = false +end + +add_mocked_facts! + if File.exist?(File.join(__dir__, 'default_module_facts.yml')) facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) facts&.each do |name, value| add_custom_fact name.to_sym, value end end +Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f }