forked from voxpupuli/puppet-staging
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use strict_variables when puppet version >= 3.5
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,29 @@ | ||
require 'rubygems' | ||
require 'puppetlabs_spec_helper/module_spec_helper' | ||
|
||
RSpec.configure do |c| | ||
c.include PuppetlabsSpec::Files | ||
|
||
c.before :each do | ||
# Ensure that we don't accidentally cache facts and environment | ||
# between test cases. | ||
Facter::Util::Loader.any_instance.stubs(:load_all) | ||
Facter.clear | ||
Facter.clear_messages | ||
|
||
# Store any environment variables away to be restored later | ||
@old_env = {} | ||
ENV.each_key {|k| @old_env[k] = ENV[k]} | ||
|
||
if Gem::Version.new(`puppet --version`) >= Gem::Version.new('3.5') | ||
Puppet.settings[:strict_variables]=true | ||
end | ||
if ENV['PARSER'] | ||
Puppet.settings[:parser]=ENV['PARSER'] | ||
end | ||
end | ||
|
||
c.after :each do | ||
PuppetlabsSpec::Files.cleanup | ||
end | ||
end |