require 'puppetlabs_spec_helper/puppet_spec_helper' require 'puppet/util' RSpec.configure do |config| def create_environmentdir(environment) envdir = File.join(Puppet[:environmentpath], environment) if not Dir.exists?(envdir) Dir.mkdir(envdir) end end # before :each do # @logs = [] # Puppet::Util::Log.level = :info # Puppet::Util::Log.newdestination(Puppet::Test::LogCollector.new(@logs)) # # dir = File.join(File.expand_path(File.dirname(__FILE__)), 'fixtures') # # environments = Puppet::Environments::Cached.new( # # Puppet::Environments::Directories.new(dir, []) # # ) # # Puppet.push_context( # # { # # :environments => environments, # # :current_environment => Puppet::Node::Environment.create(:testing, []) # # } # # ) # # print(Puppet.lookup(:environments)) # def test_logs # @logs.map(&:message) # end # end end