summaryrefslogtreecommitdiff
path: root/spec/spec_helper.rb
diff options
context:
space:
mode:
authorcprice <chris@puppetlabs.com>2012-03-27 10:38:38 -0700
committerJeff McCune <jeff@puppetlabs.com>2012-03-29 16:25:09 -0700
commit82194ca7e7c6fdf45db121a360e4dc125a8273b5 (patch)
treef8df12a4ec009668ffb434f5034886fdffd5e675 /spec/spec_helper.rb
parent10c793f8f0bca08a42237bddd18100e649e80df1 (diff)
downloadpuppet-stdlib-82194ca7e7c6fdf45db121a360e4dc125a8273b5.tar.gz
puppet-stdlib-82194ca7e7c6fdf45db121a360e4dc125a8273b5.tar.bz2
(#13439) refactor spec helper for compatibility with both puppet 2.7 and
master
Diffstat (limited to 'spec/spec_helper.rb')
-rw-r--r--spec/spec_helper.rb12
1 files changed, 2 insertions, 10 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index 87aac34..d6837a9 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -65,22 +65,14 @@ RSpec.configure do |config|
config.before :each do
GC.disable
- # these globals are set by Application
- $puppet_application_mode = nil
- $puppet_application_name = nil
# REVISIT: I think this conceals other bad tests, but I don't have time to
# fully diagnose those right now. When you read this, please come tell me
# I suck for letting this float. --daniel 2011-04-21
Signal.stubs(:trap)
- # Set the confdir and vardir to gibberish so that tests
- # have to be correctly mocked.
- Puppet[:confdir] = "/dev/null"
- Puppet[:vardir] = "/dev/null"
+ Puppet.settings.send(:initialize_everything_for_tests)
- # Avoid opening ports to the outside world
- Puppet.settings[:bindaddress] = "127.0.0.1"
@logs = []
Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(@logs))
@@ -89,7 +81,7 @@ RSpec.configure do |config|
end
config.after :each do
- Puppet.settings.clear
+ Puppet.settings.send(:clear_everything_for_tests)
Puppet::Node::Environment.clear
Puppet::Util::Storage.clear
Puppet::Util::ExecutionStub.reset if Puppet::Util.constants.include? "ExecutionStub"