Sha256: 6bf0aacca4f5ab698a8a75fe69b77bd4680a77d4378112bef0dba0e9f849998b

Contents?: true

Size: 906 Bytes

Versions: 278

Compression:

Stored size: 906 Bytes

Contents

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

require 'puppet/type'

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

  before do
    Puppet.settings.stubs(: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

278 entries across 278 versions & 1 rubygems

Version Path
puppet-6.0.3 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.3-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.3-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.3-universal-darwin spec/unit/type/noop_metaparam_spec.rb
puppet-5.5.7 spec/unit/type/noop_metaparam_spec.rb
puppet-5.5.7-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-5.5.7-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-5.5.7-universal-darwin spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.2 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.2-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.2-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.2-universal-darwin spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.1 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.1-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.1-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.1-universal-darwin spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.0 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.0-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.0-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-6.0.0-universal-darwin spec/unit/type/noop_metaparam_spec.rb