Sha256: 865a07936575937f44b0130881a6d8f0ce0f0e3afb4c3028dd9bdc165742dd93

Contents?: true

Size: 730 Bytes

Versions: 70

Compression:

Stored size: 730 Bytes

Contents

require 'spec_helper'
require 'puppet/property/boolean'

describe Puppet::Property::Boolean do
  let (:resource) { mock('resource') }
  subject { described_class.new(:resource => resource) }

  [ true, :true, 'true', :yes, 'yes', 'TrUe', 'yEs' ].each do |arg|
    it "should munge #{arg.inspect} as true" do
      subject.munge(arg).should == true
    end
  end
  [ false, :false, 'false', :no, 'no', 'FaLSE', 'nO' ].each do |arg|
    it "should munge #{arg.inspect} as false" do
      subject.munge(arg).should == 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

Version data entries

70 entries across 70 versions & 1 rubygems

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