From 643604cf33d0a7bcddeca53f7c9e62684ef108f0 Mon Sep 17 00:00:00 2001 From: Tim Meusel Date: Thu, 24 Jan 2019 23:13:09 +0100 Subject: modulesync 2.5.1 --- spec/default_facts.yml | 13 ------------- spec/spec_helper.rb | 14 +++++++++----- 2 files changed, 9 insertions(+), 18 deletions(-) delete mode 100644 spec/default_facts.yml (limited to 'spec') diff --git a/spec/default_facts.yml b/spec/default_facts.yml deleted file mode 100644 index 2f6698d..0000000 --- a/spec/default_facts.yml +++ /dev/null @@ -1,13 +0,0 @@ -# This file is managed via modulesync -# https://github.com/voxpupuli/modulesync -# https://github.com/voxpupuli/modulesync_config -# -# use default_module_facts.yaml for module specific -# facts. -# -# Hint if using with rspec-puppet-facts ("on_supported_os.each"): -# if a same named fact exists in facterdb it will be overridden. ---- -ipaddress: "172.16.254.254" -is_pe: false -macaddress: "AA:AA:AA:AA:AA:AA" diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 88bca59..2f2279d 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -5,6 +5,15 @@ require 'puppetlabs_spec_helper/module_spec_helper' require 'rspec-puppet-facts' include RspecPuppetFacts +if File.exist?(File.join(__dir__, 'default_module_facts.yml')) + facts = YAML.load(File.read(File.join(__dir__, 'default_module_facts.yml'))) + if facts + facts.each do |name, value| + add_custom_fact name.to_sym, value + end + end +end + if Dir.exist?(File.expand_path('../../lib', __FILE__)) require 'coveralls' require 'simplecov' @@ -22,11 +31,6 @@ if Dir.exist?(File.expand_path('../../lib', __FILE__)) end RSpec.configure do |c| - default_facts = {} - default_facts.merge!(YAML.load(File.read(File.expand_path('../default_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_facts.yml', __FILE__)) - default_facts.merge!(YAML.load(File.read(File.expand_path('../default_module_facts.yml', __FILE__)))) if File.exist?(File.expand_path('../default_module_facts.yml', __FILE__)) - c.default_facts = default_facts - # Coverage generation c.after(:suite) do RSpec::Puppet::Coverage.report! -- cgit v1.2.3