Skip to content

Commit

Permalink
modulesync 9.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
bastelfreak committed Aug 4, 2024
1 parent 1e00ef8 commit fb95302
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 13 deletions.
1 change: 1 addition & 0 deletions .pmtignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
/.github/
/.librarian/
/Puppetfile.lock
/Puppetfile
*.iml
/.editorconfig
/.fixtures.yml
Expand Down
20 changes: 7 additions & 13 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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 }

0 comments on commit fb95302

Please sign in to comment.