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

Add include_legacy_facts setting #41

Closed
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
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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the default could/should depend on Puppet.version.


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

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy and paste error?

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