Skip to content

Commit

Permalink
Merge pull request #217 from voxpupuli/modulesync
Browse files Browse the repository at this point in the history
facterdb_string_keys: switch to strings
  • Loading branch information
ekohl authored Jun 27, 2024
2 parents 8e1ef9d + 9edbce6 commit 9af3d19
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,5 @@ spec/spec_helper_acceptance.rb:
enabled_lint_checks:
- parameter_documentation
- parameter_types
spec/spec_helper.rb:
facterdb_string_keys: true
10 changes: 5 additions & 5 deletions spec/classes/autofs_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@
context "on #{os}" do
let(:facts) { os_facts }
let(:service) do
case facts[:os]['family']
case facts['os']['family']
when 'AIX' then 'automountd'
when 'FreeBSD' then 'automount'
else 'autofs'
end
end
let(:package) do
case facts[:os]['family']
case facts['os']['family']
when 'AIX'
'bos.net.nfs.client'
when 'Solaris'
if facts[:os]['release']['major'].to_s == '11'
if facts['os']['release']['major'].to_s == '11'
'system/file-system/autofs'
else
'SUNWatfsu' # and SUNWatfsr, but close enough
Expand All @@ -38,7 +38,7 @@
it { is_expected.to contain_class('autofs::service') }

# Check Package and service
if os_facts[:os]['family'] == 'FreeBSD'
if os_facts['os']['family'] == 'FreeBSD'
it { is_expected.to contain_service('automountd').with_ensure('running') }
it { is_expected.to contain_service('autounmountd').with_ensure('running') }
else
Expand All @@ -58,7 +58,7 @@
}
end

it { is_expected.to contain_package(package).with_ensure('absent') } if os_facts[:os]['family'] != 'FreeBSD'
it { is_expected.to contain_package(package).with_ensure('absent') } if os_facts['os']['family'] != 'FreeBSD'
end

context 'should declare mount points' do
Expand Down
2 changes: 1 addition & 1 deletion spec/defines/map_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
let(:title) { 'data' }
let(:pre_condition) { 'include autofs' }
let(:group) do
case facts[:os]['family']
case facts['os']['family']
when 'AIX' then 'system'
when 'FreeBSD' then 'wheel'
else 'root'
Expand Down
4 changes: 2 additions & 2 deletions spec/defines/mount_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,13 @@
let(:title) { 'auto.home' }
let(:pre_condition) { 'include autofs' }
let(:group) do
case facts[:os]['family']
case facts['os']['family']
when 'AIX' then 'system'
when 'FreeBSD' then 'wheel'
else 'root'
end
end
let(:master_map_file) { %w[AIX FreeBSD Solaris].include?(facts[:os]['family']) ? '/etc/auto_master' : '/etc/auto.master' }
let(:master_map_file) { %w[AIX FreeBSD Solaris].include?(facts['os']['family']) ? '/etc/auto_master' : '/etc/auto.master' }
let(:facts) { os_facts }

# rubocop:disable RSpec/MultipleMemoizedHelpers
Expand Down
4 changes: 4 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@

require 'voxpupuli/test/spec_helper'

RSpec.configure do |c|
c.facterdb_string_keys = true
end

add_mocked_facts!

if File.exist?(File.join(__dir__, 'default_module_facts.yml'))
Expand Down

0 comments on commit 9af3d19

Please sign in to comment.