Skip to content

Commit

Permalink
Use mocked facts in tests
Browse files Browse the repository at this point in the history
This uses the add_mocked_facts! from voxpupuli-test 2.2.0 rather than a
local override.
  • Loading branch information
ekohl committed Feb 23, 2021
1 parent a6c0810 commit 3d2a2c5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 26 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
source ENV['GEM_SOURCE'] || "https://rubygems.org"

group :test do
gem 'voxpupuli-test', '~> 2.1', :require => false
gem 'voxpupuli-test', '~> 2.2', :require => false
gem 'coveralls', :require => false
gem 'simplecov-console', :require => false
end
Expand Down
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

require 'voxpupuli/test/spec_helper'

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')))
if facts
Expand Down
25 changes: 0 additions & 25 deletions spec/spec_helper_local.rb
Original file line number Diff line number Diff line change
@@ -1,27 +1,2 @@
add_custom_fact :rabbitmq_version, '3.6.1' # puppet-rabbitmq
add_custom_fact :erl_ssl_path, '/usr/lib64/erlang/lib/ssl-7.3.3.1/ebin' # puppet-rabbitmq

def os_specific_facts(facts)
case facts[:os]['family']
when 'Archlinux'
{ service_provider: 'systemd', systemd: true }
when 'Debian'
case facts[:os]['release']['major']
when '7'
{ service_provider: 'sysv', systemd: false }
when '14.04'
{ service_provider: 'upstart', systemd: false }
else
{ service_provider: 'systemd', systemd: true }
end
when 'RedHat'
case facts[:os]['release']['major']
when '6'
{ service_provider: 'sysv', systemd: false }
else
{ service_provider: 'systemd', systemd: true }
end
else
{ service_provider: 'systemd', systemd: true }
end
end

0 comments on commit 3d2a2c5

Please sign in to comment.