Révision 65ed81ba
partial modulesync 9.1.0
This excludes the Gemfile changes
spec/spec_helper.rb | ||
---|---|---|
3 | 3 |
# Managed by modulesync - DO NOT EDIT |
4 | 4 |
# https://voxpupuli.org/docs/updating-files-managed-with-modulesync/ |
5 | 5 |
|
6 |
RSpec.configure do |c| |
|
7 |
c.before do |
|
8 |
# select the systemd service provider even when on docker |
|
9 |
# https://tickets.puppetlabs.com/browse/PUP-11167 |
|
10 |
if defined?(facts) && %w[Archlinux RedHat].include?(facts[:os]['family']) |
|
11 |
allow(Puppet::FileSystem).to receive(:exist?).and_call_original |
|
12 |
allow(Puppet::FileSystem).to receive(:exist?).with('/proc/1/comm').and_return(true) |
|
13 |
allow(Puppet::FileSystem).to receive(:read).and_call_original |
|
14 |
allow(Puppet::FileSystem).to receive(:read).with('/proc/1/comm').and_return(['systemd']) |
|
15 |
end |
|
16 |
end |
|
17 |
end |
|
18 |
|
|
19 | 6 |
# puppetlabs_spec_helper will set up coverage if the env variable is set. |
20 | 7 |
# We want to do this if lib exists and it hasn't been explicitly set. |
21 | 8 |
ENV['COVERAGE'] ||= 'yes' if Dir.exist?(File.expand_path('../lib', __dir__)) |
22 | 9 |
|
23 | 10 |
require 'voxpupuli/test/spec_helper' |
24 | 11 |
|
12 |
RSpec.configure do |c| |
|
13 |
c.facterdb_string_keys = false |
|
14 |
end |
|
15 |
|
|
16 |
add_mocked_facts! |
|
17 |
|
|
25 | 18 |
if File.exist?(File.join(__dir__, 'default_module_facts.yml')) |
26 | 19 |
facts = YAML.safe_load(File.read(File.join(__dir__, 'default_module_facts.yml'))) |
27 | 20 |
facts&.each do |name, value| |
28 | 21 |
add_custom_fact name.to_sym, value |
29 | 22 |
end |
30 | 23 |
end |
24 |
Dir['./spec/support/spec/**/*.rb'].sort.each { |f| require f } |
Formats disponibles : Unified diff