diff --git a/lib/rspec-puppet.rb b/lib/rspec-puppet.rb index 1650bb4a9..b8208448b 100644 --- a/lib/rspec-puppet.rb +++ b/lib/rspec-puppet.rb @@ -60,6 +60,7 @@ def self.current_example c.add_setting :fixture_hiera_configs, :default => {} c.add_setting :use_fixture_spec_hiera, :default => false c.add_setting :fallback_to_default_hiera, :default => true + c.add_setting :include_legacy_facts, :default => true c.instance_eval do def trusted_server_facts diff --git a/lib/rspec-puppet/adapters.rb b/lib/rspec-puppet/adapters.rb index 660c0af1d..40a753433 100644 --- a/lib/rspec-puppet/adapters.rb +++ b/lib/rspec-puppet/adapters.rb @@ -169,6 +169,7 @@ def settings_map [:hiera_config, :hiera_config], [:strict_variables, :strict_variables], [:manifest, :manifest], + [:include_legacy_facts, :include_legacy_facts], ]) end @@ -263,6 +264,7 @@ def settings_map super.concat([ [:basemodulepath, :basemodulepath], [:vendormoduledir, :vendormoduledir], + [:include_legacy_facts, :include_legacy_facts], ]) end diff --git a/spec/unit/adapters_spec.rb b/spec/unit/adapters_spec.rb index f7bd5c883..dcf2b8992 100644 --- a/spec/unit/adapters_spec.rb +++ b/spec/unit/adapters_spec.rb @@ -204,6 +204,11 @@ def context_double(options = {}) let(:test_context) { double :environment => 'rp_env' } + it 'sets Puppet[:strict_variables] to false by default' do + subject.setup_puppet(test_context) + expect(Puppet[:include_legacy_facts]).to eq(true) + end + describe '#setup_puppet' do describe 'when managing the facter_implementation' do after(:each) do