Sha256: 3dec07c7e33bbdc205d83e063e0d27d03d4e78efea2bd529c463ecb2059c561e

Contents?: true

Size: 1.05 KB

Versions: 21

Compression:

Stored size: 1.05 KB

Contents

#! /usr/bin/env ruby
require 'spec_helper'

require 'puppet_spec/files'

describe Puppet::Settings do
  include PuppetSpec::Files

  def minimal_default_settings
    { :noop => {:default => false, :desc => "noop"} }
  end

  it "should be able to make needed directories" do
    settings = Puppet::Settings.new
    settings.define_settings :main, minimal_default_settings.update(
        :maindir => {
            :default => tmpfile("main"),
            :type => :directory,
            :desc => "a",
        }
    )
    settings.use(:main)

    File.should be_directory(settings[:maindir])
  end

  it "should make its directories with the correct modes" do
    settings = Puppet::Settings.new
    settings.define_settings :main,  minimal_default_settings.update(
        :maindir => {
            :default => tmpfile("main"),
            :type => :directory,
            :desc => "a",
            :mode => 0750
        }
    )

    settings.use(:main)

    (File.stat(settings[:maindir]).mode & 007777).should == (Puppet.features.microsoft_windows? ? 0755 : 0750)
  end
end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
puppet-3.2.4 spec/integration/util/settings_spec.rb
puppet-3.2.3 spec/integration/util/settings_spec.rb
puppet-3.2.3.rc1 spec/integration/util/settings_spec.rb
puppet-3.2.2 spec/integration/util/settings_spec.rb
puppet-3.2.1 spec/integration/util/settings_spec.rb
puppet-3.2.1.rc1 spec/integration/util/settings_spec.rb
puppet-3.2.0.rc2 spec/integration/util/settings_spec.rb
librarian-puppet-0.9.9 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/spec/integration/util/settings_spec.rb
puppet-3.2.0.rc1 spec/integration/util/settings_spec.rb
puppet-3.1.1 spec/integration/util/settings_spec.rb
librarian-puppet-0.9.8 vendor/gems/ruby/1.9.1/gems/puppet-3.1.0/spec/integration/util/settings_spec.rb
puppet-3.1.0 spec/integration/util/settings_spec.rb
puppet-3.1.0.rc2 spec/integration/util/settings_spec.rb
puppet-3.1.0.rc1 spec/integration/util/settings_spec.rb
puppet-3.0.2 spec/integration/util/settings_spec.rb
puppet-3.0.2.rc3 spec/integration/util/settings_spec.rb
puppet-3.0.2.rc2 spec/integration/util/settings_spec.rb
puppet-3.0.2.rc1 spec/integration/util/settings_spec.rb
puppet-3.0.1 spec/integration/util/settings_spec.rb
puppet-3.0.1.rc1 spec/integration/util/settings_spec.rb