Merge branch 'ticket/2.2.x/13439_fix_spec_helper_try2' into 2.2.x
* ticket/2.2.x/13439_fix_spec_helper_try2: (#13439) Fix test failures with Puppet 2.6.x
This commit is contained in:
commit
d22fbe32cd
1 changed files with 12 additions and 2 deletions
|
@ -71,7 +71,12 @@ RSpec.configure do |config|
|
||||||
# I suck for letting this float. --daniel 2011-04-21
|
# I suck for letting this float. --daniel 2011-04-21
|
||||||
Signal.stubs(:trap)
|
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 = []
|
@logs = []
|
||||||
|
@ -81,7 +86,12 @@ RSpec.configure do |config|
|
||||||
end
|
end
|
||||||
|
|
||||||
config.after :each do
|
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::Node::Environment.clear
|
||||||
Puppet::Util::Storage.clear
|
Puppet::Util::Storage.clear
|
||||||
Puppet::Util::ExecutionStub.reset if Puppet::Util.constants.include? "ExecutionStub"
|
Puppet::Util::ExecutionStub.reset if Puppet::Util.constants.include? "ExecutionStub"
|
||||||
|
|
Loading…
Reference in a new issue