Skip to content

Commit

Permalink
Add include_legacy_facts setting
Browse files Browse the repository at this point in the history
  • Loading branch information
crazymind1337 committed Feb 20, 2023
1 parent 9f93612 commit 57620ec
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/rspec-puppet.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 2 additions & 0 deletions lib/rspec-puppet/adapters.rb
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def settings_map
[:hiera_config, :hiera_config],
[:strict_variables, :strict_variables],
[:manifest, :manifest],
[:include_legacy_facts, :include_legacy_facts],
])
end

Expand Down Expand Up @@ -263,6 +264,7 @@ def settings_map
super.concat([
[:basemodulepath, :basemodulepath],
[:vendormoduledir, :vendormoduledir],
[:include_legacy_facts, :include_legacy_facts],
])
end

Expand Down
5 changes: 5 additions & 0 deletions spec/unit/adapters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 57620ec

Please sign in to comment.