Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

facterdb_string_keys: switch to strings #217

Merged
merged 1 commit into from
Jun 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading