summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff McCune <jeff@puppetlabs.com>2012-03-29 23:18:39 -0700
committerJeff McCune <jeff@puppetlabs.com>2012-03-29 23:18:39 -0700
commit69465b0f3e0c0c5284812bfa76ab8d3c254d10a9 (patch)
tree37e317b247770df92325bb7539b4a7cf76144d45
parentd22fbe32cd626091b32c8a0c0a8c83771a0c999a (diff)
parent15c5fd1f41f5d6585edb1bb0adcae4c1c8bd2def (diff)
downloadpuppet-stdlib-69465b0f3e0c0c5284812bfa76ab8d3c254d10a9.tar.gz
puppet-stdlib-69465b0f3e0c0c5284812bfa76ab8d3c254d10a9.tar.bz2
Merge branch 'ticket/2.2.x/13439_fix_spec_helper_try3' into 2.2.x
* ticket/2.2.x/13439_fix_spec_helper_try3: (#13439) Fix MRI 1.9 issue with spec_helper
-rw-r--r--spec/spec_helper.rb14
1 files changed, 4 insertions, 10 deletions
diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index d0b493e..92fe1ad 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -72,11 +72,8 @@ RSpec.configure do |config|
Signal.stubs(:trap)
# 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
+ # should only be used for tests. Puppet 2.6.x does not have the method.
+ Puppet.settings.send(:initialize_everything_for_tests) unless Puppet.version =~ /^2\.6/
@logs = []
@@ -87,11 +84,8 @@ RSpec.configure do |config|
config.after :each do
# 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
+ # should only be used for tests. Puppet 2.6.x does not have the method.
+ Puppet.settings.send(:clear_everything_for_tests) unless Puppet.version =~ /^2\.6/
Puppet::Node::Environment.clear
Puppet::Util::Storage.clear
Puppet::Util::ExecutionStub.reset if Puppet::Util.constants.include? "ExecutionStub"