Sha256: 32c1524d8d9676ead988299b1792c1d852ac7211483e32d8f99a5d32ddbcaee0
Contents?: true
Size: 1.05 KB
Versions: 340
Compression:
Stored size: 1.05 KB
Contents
require 'spec_helper' require 'puppet' require 'puppet/parameter/boolean' describe Puppet::Parameter::Boolean do let (:resource) { double('resource') } describe "after initvars" do before { described_class.initvars } it "should have the correct value_collection" do expect(described_class.value_collection.values.sort).to eq( [:true, :false, :yes, :no].sort ) end end describe "instances" do subject { described_class.new(:resource => resource) } [ true, :true, 'true', :yes, 'yes', 'TrUe', 'yEs' ].each do |arg| it "should munge #{arg.inspect} as true" do expect(subject.munge(arg)).to eq(true) end end [ false, :false, 'false', :no, 'no', 'FaLSE', 'nO' ].each do |arg| it "should munge #{arg.inspect} as false" do expect(subject.munge(arg)).to eq(false) end end [ nil, :undef, 'undef', '0', 0, '1', 1, 9284 ].each do |arg| it "should fail to munge #{arg.inspect}" do expect { subject.munge(arg) }.to raise_error Puppet::Error end end end end
Version data entries
340 entries across 340 versions & 1 rubygems