Sha256: a6709d458b25fe2ab19bd54a4719f9bc5b8ec3847fb2728749c719868d2af914

Contents?: true

Size: 1.55 KB

Versions: 19

Compression:

Stored size: 1.55 KB

Contents

#!/usr/bin/env ruby

Dir.chdir(File.dirname(__FILE__)) { (s = lambda { |f| File.exist?(f) ? require(f) : Dir.chdir("..") { s.call(f) } }).call("spec/spec_helper.rb") }

describe Puppet::Type.type(:selboolean), "when validating attributes" do
  [:name, :persistent].each do |param|
    it "should have a #{param} parameter" do
      Puppet::Type.type(:selboolean).attrtype(param).should == :param
    end
  end

  it "should have a value property" do
    Puppet::Type.type(:selboolean).attrtype(:value).should == :property
  end
end

describe Puppet::Type.type(:selboolean), "when validating values" do
  before do
    @class = Puppet::Type.type(:selboolean)

    @provider_class = stub 'provider_class', :name => "fake", :suitable? => true, :supports_parameter? => true
    @class.stubs(:defaultprovider).returns(@provider_class)
    @class.stubs(:provider).returns(@provider_class)

    @provider = stub 'provider', :class => @provider_class, :clear => nil
    @provider_class.stubs(:new).returns(@provider)
  end

  it "should support :on as a value to :value" do
    Puppet::Type.type(:selboolean).new(:name => "yay", :value => :on)
  end

  it "should support :off as a value to :value" do
    Puppet::Type.type(:selboolean).new(:name => "yay", :value => :off)
  end

  it "should support :true as a value to :persistent" do
    Puppet::Type.type(:selboolean).new(:name => "yay", :value => :on, :persistent => :true)
  end

  it "should support :false as a value to :persistent" do
    Puppet::Type.type(:selboolean).new(:name => "yay", :value => :on, :persistent => :false)
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
puppet-2.6.18 spec/unit/type/selboolean_spec.rb
puppet-2.6.17 spec/unit/type/selboolean_spec.rb
puppet-2.6.16 spec/unit/type/selboolean_spec.rb
puppet-2.6.15 spec/unit/type/selboolean_spec.rb
puppet-2.6.14 spec/unit/type/selboolean_spec.rb
puppet-2.6.13 spec/unit/type/selboolean_spec.rb
puppet-2.6.12 spec/unit/type/selboolean_spec.rb
puppet-2.6.11 spec/unit/type/selboolean_spec.rb
puppet-2.6.10 spec/unit/type/selboolean_spec.rb
puppet-2.6.9 spec/unit/type/selboolean_spec.rb
puppet-2.6.8 spec/unit/type/selboolean_spec.rb
puppet-2.6.7 spec/unit/type/selboolean_spec.rb
puppet-2.6.6 spec/unit/type/selboolean_spec.rb
puppet-2.6.5 spec/unit/type/selboolean_spec.rb
puppet-2.6.4 spec/unit/type/selboolean_spec.rb
puppet-2.6.3 spec/unit/type/selboolean_spec.rb
puppet-2.6.2 spec/unit/type/selboolean_spec.rb
puppet-2.6.1 spec/unit/type/selboolean_spec.rb
puppet-2.6.0 spec/unit/type/selboolean_spec.rb