summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff McCune <jeff@puppetlabs.com>2012-03-29 16:55:46 -0700
committerJeff McCune <jeff@puppetlabs.com>2012-03-29 16:55:46 -0700
commit6065628493e775e3e6ddb59f272bd36a9e9fe072 (patch)
treee56b88c89e00cfa75fbb30dd84ef77fd1bef525a
parent4ab56c385ac65129c84b085d60bcfd7e0aa126ff (diff)
parentd22fbe32cd626091b32c8a0c0a8c83771a0c999a (diff)
downloadpuppet-stdlib-6065628493e775e3e6ddb59f272bd36a9e9fe072.tar.gz
puppet-stdlib-6065628493e775e3e6ddb59f272bd36a9e9fe072.tar.bz2
Merge branch '2.2.x' into 2.3.x
* 2.2.x: (#13439) Fix test failures with Puppet 2.6.x
-rw-r--r--spec/spec_helper.rb14
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index e29c315..9c69b53 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -69,7 +69,12 @@ RSpec.configure do |config|
# I suck for letting this float. --daniel 2011-04-21
Signal.stubs(:trap)
- Puppet.settings.send(:initialize_everything_for_tests)
+ # We're using send because this is a private method to communicate it
+ # should only be used for tests. We're testing if it's defined to work
+ # with Puppet 2.6.x which does not have the method.
+ if Puppet.settings.private_methods.include? "initialize_everything_for_tests"
+ Puppet.settings.send(:initialize_everything_for_tests)
+ end
@logs = []
@@ -79,7 +84,12 @@ RSpec.configure do |config|
end
config.after :each do
- Puppet.settings.send(:clear_everything_for_tests)
+ # We're using send because this is a private method to communicate it
+ # should only be used for tests. We're testing if it's defined to work
+ # with Puppet 2.6.x which does not have the method at all.
+ if Puppet.settings.private_methods.include? "clear_everything_for_tests"
+ Puppet.settings.send(:clear_everything_for_tests)
+ end
Puppet::Node::Environment.clear
Puppet::Util::Storage.clear
Puppet::Util::ExecutionStub.reset if Puppet::Util.constants.include? "ExecutionStub"