azure-puppet/spec/spec_helper.rb

36 строки
966 B
Ruby
Исходник Постоянная ссылка Обычный вид История

#-------------------------------------------------------------------------
# Copyright (c) Microsoft Open Technologies, Inc.
# All Rights Reserved. Licensed under the Apache 2.0 License.
#--------------------------------------------------------------------------
2013-12-26 10:48:03 +04:00
# encoding: UTF-8
2013-12-18 13:18:45 +04:00
require 'puppet'
require 'puppet/face'
require 'azure'
require 'mocha/api'
gem 'rspec', '>=2.0.0'
2013-12-24 11:55:42 +04:00
Dir['./spec/support/**/*.rb'].sort.each { |f| require f }
2013-12-18 13:18:45 +04:00
RSpec.configure do |config|
config.mock_with :mocha
config.after :each do
Puppet.settings.clear
Puppet::Node::Environment.clear
Puppet::Util::Storage.clear
Puppet::Util::Log.close_all
end
config.before :each do
$puppet_application_mode = nil
$puppet_application_name = nil
2013-12-19 11:41:09 +04:00
Puppet[:confdir] = '/dev/null'
Puppet[:vardir] = '/dev/null'
Puppet.settings[:bindaddress] = '127.0.0.1'
2013-12-18 13:18:45 +04:00
@logs = []
Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(@logs))
end
end