Sha256: 834534b406a2c6ed4ceb3ef3158fe2ec28bb1bda72e103e1ef133bb72f2f51d9

Contents?: true

Size: 897 Bytes

Versions: 340

Compression:

Stored size: 897 Bytes

Contents

require 'spec_helper'

require 'puppet/type'

describe Puppet::Type.type(:file).attrclass(:noop) do
  include PuppetSpec::Files

  before do
    allow(Puppet.settings).to receive(:use)
    @file = Puppet::Type.newfile :path => make_absolute("/what/ever")
  end

  it "should accept true as a value" do
    expect { @file[:noop] = true }.not_to raise_error
  end

  it "should accept false as a value" do
    expect { @file[:noop] = false }.not_to raise_error
  end

  describe "when set on a resource" do
    it "should default to the :noop setting" do
      Puppet[:noop] = true
      expect(@file.noop).to eq(true)
    end

    it "should prefer true values from the attribute" do
      @file[:noop] = true
      expect(@file.noop).to be_truthy
    end

    it "should prefer false values from the attribute" do
      @file[:noop] = false
      expect(@file.noop).to be_falsey
    end
  end
end

Version data entries

340 entries across 340 versions & 1 rubygems

Version Path
puppet-6.27.0 spec/unit/type/noop_metaparam_spec.rb
puppet-6.27.0-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.27.0-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.27.0-universal-darwin spec/unit/type/noop_metaparam_spec.rb
puppet-7.16.0 spec/unit/type/noop_metaparam_spec.rb
puppet-7.16.0-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-7.16.0-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-7.16.0-universal-darwin spec/unit/type/noop_metaparam_spec.rb
puppet-7.15.0 spec/unit/type/noop_metaparam_spec.rb
puppet-7.15.0-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-7.15.0-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-7.15.0-universal-darwin spec/unit/type/noop_metaparam_spec.rb
puppet-6.26.0 spec/unit/type/noop_metaparam_spec.rb
puppet-6.26.0-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.26.0-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.26.0-universal-darwin spec/unit/type/noop_metaparam_spec.rb
puppet-7.14.0 spec/unit/type/noop_metaparam_spec.rb
puppet-7.14.0-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-7.14.0-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-7.14.0-universal-darwin spec/unit/type/noop_metaparam_spec.rb