Module: RSpec::Puppet::Support

Defined in:
rake_modules/spec_helper.rb

Instance Method Summary collapse

Instance Method Details

#setup_puppetObject



52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'rake_modules/spec_helper.rb', line 52

def setup_puppet
  vardir = Dir.mktmpdir
  Puppet[:vardir] = vardir
  if Puppet::Util::Package.versioncmp(Puppet.version, '4.3.0') >= 0 && Puppet.version.to_i < 5
    Puppet[:app_management] = ENV.include?('PUPPET_NOAPP_MANAGEMENT') ? false : true
  end
  load_path = adapter.modulepath.map do |d|
    Dir["#{d}/*/lib"].entries
  end
  load_path.flatten.each do |lib|
    $LOAD_PATH << lib
  end
  vardir
end