Sha256: d2060729a0ffce555ee106d95b67947b95c9db80c71fbd1bec0fac1394a9a630

Contents?: true

Size: 898 Bytes

Versions: 92

Compression:

Stored size: 898 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
    lambda { @file[:noop] = true }.should_not raise_error
  end

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

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

    it "should prefer true values from the attribute" do
      @file[:noop] = true
      @file.noop.should be_true
    end

    it "should prefer false values from the attribute" do
      @file[:noop] = false
      @file.noop.should be_false
    end
  end
end

Version data entries

92 entries across 92 versions & 2 rubygems

Version Path
puppet-3.8.7 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.7-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.7-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.6 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.6-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.6-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.5 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.5-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.5-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.4 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.4-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.4-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.3 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.3-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.3-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.2 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.2-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.2-x64-mingw32 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.1 spec/unit/type/noop_metaparam_spec.rb
puppet-3.8.1-x86-mingw32 spec/unit/type/noop_metaparam_spec.rb