summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff McCune <jeff@puppetlabs.com>2012-03-29 16:26:13 -0700
committerJeff McCune <jeff@puppetlabs.com>2012-03-29 16:26:13 -0700
commit4ab56c385ac65129c84b085d60bcfd7e0aa126ff (patch)
treee540a05bd3169c7514e9780fc0e59a0053122b1e
parentfea0b06bc828f452900943db962f4f7645bb0802 (diff)
parentcbdffb711fb109628ecdada9083f064b2e8d3a64 (diff)
downloadpuppet-stdlib-4ab56c385ac65129c84b085d60bcfd7e0aa126ff.tar.gz
puppet-stdlib-4ab56c385ac65129c84b085d60bcfd7e0aa126ff.tar.bz2
Merge branch '2.2.x' into 2.3.x
* 2.2.x: (#13439) refactor spec helper for compatibility with both puppet 2.7 and master
-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 ad736d8..e29c315 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -63,22 +63,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))
@@ -87,7 +79,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"