aboutsummaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorTim Meusel <tim@bastelfreak.de>2019-01-24 23:13:09 +0100
committerTim Meusel <tim@bastelfreak.de>2019-01-24 23:13:24 +0100
commit643604cf33d0a7bcddeca53f7c9e62684ef108f0 (patch)
treed1301539acb6f590e1fbe3bac84147fdaaa63a92 /spec
parent3612961ef7599afe37e224271629eb721965536c (diff)
downloadpuppet-ferm-643604cf33d0a7bcddeca53f7c9e62684ef108f0.tar.gz
puppet-ferm-643604cf33d0a7bcddeca53f7c9e62684ef108f0.tar.bz2
modulesync 2.5.1
Diffstat (limited to 'spec')
-rw-r--r--spec/default_facts.yml13
-rw-r--r--spec/spec_helper.rb14
2 files changed, 9 insertions, 18 deletions
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!