Sha256: bf995e480a167f55b3200bc7ee2ac5d1359f81dd4f3528baf6f1d198ee28824c

Contents?: true

Size: 905 Bytes

Versions: 30

Compression:

Stored size: 905 Bytes

Contents

require 'spec_helper'

describe "setting hooks" do
  let(:confdir) { Puppet[:confdir] }
  let(:environmentpath) { File.expand_path("envdir", confdir) }

  describe "reproducing PUP-3500" do
    let(:productiondir) { File.join(environmentpath, "production") }

    before(:each) do
      FileUtils.mkdir_p(productiondir)
    end

    it "accesses correct directory environment settings after intializing a setting with an on_write hook" do
      expect(Puppet.settings.setting(:certname).call_hook).to eq(:on_write_only) 

      File.open(File.join(confdir, "puppet.conf"), "w") do |f|
        f.puts("environmentpath=#{environmentpath}")
        f.puts("certname=something")
      end

      Puppet.initialize_settings
      production_env = Puppet.lookup(:environments).get(:production)
      expect(Puppet.settings.value(:manifest, production_env)).to eq("#{productiondir}/manifests")
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
puppet-3.8.7 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.7-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.7-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.6 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.6-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.6-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.5 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.5-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.5-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.4 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.4-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.4-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.3 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.3-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.3-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.2 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.2-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.2-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.1 spec/integration/environments/setting_hooks_spec.rb
puppet-3.8.1-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb