Sha256: 1336e48f7268da4fc0871d0512f0b8b5269c14a2797f38a4bfcb00accd594595

Contents?: true

Size: 906 Bytes

Versions: 86

Compression:

Stored size: 906 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 initializing 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

86 entries across 86 versions & 1 rubygems

Version Path
puppet-4.8.2 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.2-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.2-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.2-universal-darwin spec/integration/environments/setting_hooks_spec.rb
puppet-4.7.1 spec/integration/environments/setting_hooks_spec.rb
puppet-4.7.1-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.7.1-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.7.1-universal-darwin spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.1 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.1-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.1-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.1-universal-darwin spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.0 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.0-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.0-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.8.0-universal-darwin spec/integration/environments/setting_hooks_spec.rb
puppet-4.7.0 spec/integration/environments/setting_hooks_spec.rb
puppet-4.7.0-x86-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.7.0-x64-mingw32 spec/integration/environments/setting_hooks_spec.rb
puppet-4.7.0-universal-darwin spec/integration/environments/setting_hooks_spec.rb