Skip to content

Commit dcdd939

Browse files
authored
Merge pull request #389 from ekohl/use-rspec-puppet-settings
Use rspec-puppet settings to configure Puppet
2 parents 1f86cf6 + 82f3760 commit dcdd939

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/puppetlabs_spec_helper/module_spec_helper.rb

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,16 @@ def verify_contents(subject, title, expected_lines)
6969
c.module_path = module_path
7070
c.manifest_dir = File.join(fixture_path, 'manifests')
7171

72+
# https://github.com/puppetlabs/rspec-puppet#strict_variables
73+
c.strict_variables = ENV['STRICT_VARIABLES'] != 'no'
74+
# https://github.com/puppetlabs/rspec-puppet#ordering
75+
c.ordering = ENV['ORDERING'] if ENV['ORDERING']
76+
7277
c.before :each do
7378
if c.mock_framework.framework_name == :rspec
7479
allow(Puppet.features).to receive(:root?).and_return(true)
7580
else
7681
Puppet.features.stubs(:root?).returns(true)
7782
end
78-
79-
Puppet.settings[:strict_variables] = true if ENV['STRICT_VARIABLES'] == 'yes' || ENV['STRICT_VARIABLES'] != 'no'
80-
Puppet.settings[:ordering] = ENV['ORDERING'] if ENV['ORDERING']
8183
end
8284
end

0 commit comments

Comments
 (0)