diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 4073cb60b..3b04636f3 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -1,42 +1,44 @@ require 'pathname' dir = Pathname.new(__FILE__).parent $LOAD_PATH.unshift(dir, dir + 'lib', dir + '../lib') require 'mocha' require 'puppet' require 'puppet/string' require 'rspec' Pathname.glob("#{dir}/shared_behaviours/**/*.rb") do |behaviour| require behaviour.relative_path_from(dir) end RSpec.configure do |config| - config.mock_with :mocha + config.mock_with :mocha - config.before :each do - # Set the confdir and vardir to gibberish so that tests - # have to be correctly mocked. - Puppet[:confdir] = "/dev/null" - Puppet[:vardir] = "/dev/null" + config.before :each do + # Set the confdir and vardir to gibberish so that tests + # have to be correctly mocked. + Puppet[:confdir] = "/dev/null" + Puppet[:vardir] = "/dev/null" - # Avoid opening ports to the outside world - Puppet.settings[:bindaddress] = "127.0.0.1" + # Avoid opening ports to the outside world + Puppet.settings[:bindaddress] = "127.0.0.1" - @logs = [] - Puppet::Util::Log.newdestination(@logs) - end + @logs = [] + Puppet::Util::Log.newdestination(@logs) - config.after :each do - Puppet.settings.clear + + end - @logs.clear - Puppet::Util::Log.close_all - end + config.after :each do + Puppet.settings.clear + + @logs.clear + Puppet::Util::Log.close_all + end end # We need this because the RAL uses 'should' as a method. This # allows us the same behaviour but with a different method name. class Object - alias :must :should + alias :must :should end