diff --git a/.sync.yml b/.sync.yml index 7a786f8..e23edb1 100644 --- a/.sync.yml +++ b/.sync.yml @@ -5,3 +5,4 @@ - parameter_types spec/spec_helper.rb: hiera_config: "'spec/fixtures/hiera/hiera.yaml'" + facterdb_string_keys: true diff --git a/spec/classes/varnish_firewall_spec.rb b/spec/classes/varnish_firewall_spec.rb index 045a3e5..ea99bd8 100644 --- a/spec/classes/varnish_firewall_spec.rb +++ b/spec/classes/varnish_firewall_spec.rb @@ -3,10 +3,10 @@ require 'spec_helper' describe 'varnish::firewall', type: :class do - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end context 'default values' do diff --git a/spec/classes/varnish_install_spec.rb b/spec/classes/varnish_install_spec.rb index 40e7b41..3859157 100644 --- a/spec/classes/varnish_install_spec.rb +++ b/spec/classes/varnish_install_spec.rb @@ -3,10 +3,10 @@ require 'spec_helper' describe 'varnish::install', type: :class do - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end context 'default values' do diff --git a/spec/classes/varnish_ncsa_spec.rb b/spec/classes/varnish_ncsa_spec.rb index bee2637..59a88e0 100644 --- a/spec/classes/varnish_ncsa_spec.rb +++ b/spec/classes/varnish_ncsa_spec.rb @@ -7,10 +7,10 @@ 'include varnish' end - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end context 'default values' do diff --git a/spec/classes/varnish_repo_spec.rb b/spec/classes/varnish_repo_spec.rb index c8e2d03..f9dd312 100644 --- a/spec/classes/varnish_repo_spec.rb +++ b/spec/classes/varnish_repo_spec.rb @@ -22,7 +22,7 @@ it { is_expected.to compile } - case os_facts[:osfamily] + case os_facts['os']['family'] when 'Debian' it { is_expected.to contain_apt__source('varnish').with( diff --git a/spec/classes/varnish_shmlog_spec.rb b/spec/classes/varnish_shmlog_spec.rb index e756cf3..a13688f 100644 --- a/spec/classes/varnish_shmlog_spec.rb +++ b/spec/classes/varnish_shmlog_spec.rb @@ -3,10 +3,10 @@ require 'spec_helper' describe 'varnish::shmlog', type: :class do - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end context 'default values' do @@ -19,7 +19,7 @@ ) } - if facts[:os]['selinux']['enabled'] == true + if os_facts['os']['selinux']['enabled'] == true it { is_expected.to contain_mount('shmlog-mount').with( 'target' => '/etc/fstab', diff --git a/spec/classes/varnish_spec.rb b/spec/classes/varnish_spec.rb index 599c7e1..0c02754 100644 --- a/spec/classes/varnish_spec.rb +++ b/spec/classes/varnish_spec.rb @@ -3,10 +3,10 @@ require 'spec_helper' describe 'varnish', type: :class do - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end # Base Checks for all OS @@ -67,7 +67,7 @@ ) } - if facts[:osfamily] == 'RedHat' + if os_facts['os']['family'] == 'RedHat' it { is_expected.to contain_file('varnish-conf').without_content(%r{\s -j unix,user=vcache}) } else it { is_expected.to contain_file('varnish-conf').with_content(%r{\s -j unix,user=vcache}) } @@ -161,7 +161,7 @@ it { is_expected.to compile } it { is_expected.to contain_class('varnish::install').with_version('6.0.0-manual') } - if facts[:osfamily] == 'RedHat' + if os_facts['os']['family'] == 'RedHat' it { is_expected.to contain_file('varnish-conf').without_content(%r{\s -j unix,user=vcache}) } else it { is_expected.to contain_file('varnish-conf').with_content(%r{\s -j unix,user=vcache}) } diff --git a/spec/classes/varnish_vcl_spec.rb b/spec/classes/varnish_vcl_spec.rb index 60aabe9..82fb194 100644 --- a/spec/classes/varnish_vcl_spec.rb +++ b/spec/classes/varnish_vcl_spec.rb @@ -3,10 +3,10 @@ require 'spec_helper' describe 'varnish::vcl', type: :class do - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end let :pre_condition do 'include varnish' diff --git a/spec/defines/varnish_vcl_acl_spec.rb b/spec/defines/varnish_vcl_acl_spec.rb index 3c4653b..d04d0c8 100644 --- a/spec/defines/varnish_vcl_acl_spec.rb +++ b/spec/defines/varnish_vcl_acl_spec.rb @@ -13,10 +13,10 @@ let(:title) { 'foo' } let(:facts) { { concat_basedir: '/dne' } } - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end let(:params) { { hosts: ['192.168.10.14'] } } diff --git a/spec/defines/varnish_vcl_backend_spec.rb b/spec/defines/varnish_vcl_backend_spec.rb index 970e081..2c07b0b 100644 --- a/spec/defines/varnish_vcl_backend_spec.rb +++ b/spec/defines/varnish_vcl_backend_spec.rb @@ -10,10 +10,10 @@ ] end - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end let(:title) { 'foo' } diff --git a/spec/defines/varnish_vcl_director_spec.rb b/spec/defines/varnish_vcl_director_spec.rb index 99ccaa8..f856afa 100644 --- a/spec/defines/varnish_vcl_director_spec.rb +++ b/spec/defines/varnish_vcl_director_spec.rb @@ -11,10 +11,10 @@ end let(:title) { 'foo' } - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end let(:params) { { backends: ['192.168.10.14'] } } diff --git a/spec/defines/varnish_vcl_selector_spec.rb b/spec/defines/varnish_vcl_selector_spec.rb index d1e5fda..06242a2 100644 --- a/spec/defines/varnish_vcl_selector_spec.rb +++ b/spec/defines/varnish_vcl_selector_spec.rb @@ -10,10 +10,10 @@ ] end - on_supported_os.each do |os, facts| + on_supported_os.each do |os, os_facts| context "on #{os}" do let :facts do - facts + os_facts end let(:title) { 'foo' } diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 214e983..6caaa42 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -10,7 +10,7 @@ require 'voxpupuli/test/spec_helper' RSpec.configure do |c| - c.facterdb_string_keys = false + c.facterdb_string_keys = true c.hiera_config = 'spec/fixtures/hiera/hiera.yaml' end