Sha256: 7a9f0eab5786994291ecbd6693fc1fef42fb79361b73f6c1d2cac3113fc294e8
Contents?: true
Size: 803 Bytes
Versions: 16
Compression:
Stored size: 803 Bytes
Contents
# Set FACTERDIR so that facter.rb can find libfacter.so ENV['FACTERDIR'] = '${CMAKE_BINARY_DIR}' # Add the location of libfacter.so to the path for Windows ENV['PATH'] = '${CMAKE_BINARY_DIR}/${LIBFACTER_INSTALL_DESTINATION}' + File::PATH_SEPARATOR + ENV['PATH'] require 'mocha' require 'rspec' require '${CMAKE_BINARY_DIR}/lib/facter.rb' RSpec.configure do |config| config.mock_with :mocha config.before :each do # Store any environment variables away to be restored later @old_env = {} ENV.each_key {|k| @old_env[k] = ENV[k]} end config.after :each do # Restore environment variables after execution of each test @old_env.each_pair {|k, v| ENV[k] = v} to_remove = ENV.keys.reject {|key| @old_env.include? key } to_remove.each {|key| ENV.delete key } end end
Version data entries
16 entries across 16 versions & 2 rubygems