Sha256: 7a6040388af5b0f320bb173a68f5345b61dcf45cc9c3ab1fa8c9bd8e5e272b02

Contents?: true

Size: 740 Bytes

Versions: 278

Compression:

Stored size: 740 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
      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

Version data entries

278 entries across 278 versions & 1 rubygems

Version Path
puppet-6.4.0 spec/unit/property/boolean_spec.rb
puppet-6.4.0-x86-mingw32 spec/unit/property/boolean_spec.rb
puppet-6.4.0-x64-mingw32 spec/unit/property/boolean_spec.rb
puppet-6.4.0-universal-darwin spec/unit/property/boolean_spec.rb
puppet-6.0.7 spec/unit/property/boolean_spec.rb
puppet-6.0.7-x86-mingw32 spec/unit/property/boolean_spec.rb
puppet-6.0.7-x64-mingw32 spec/unit/property/boolean_spec.rb
puppet-6.0.7-universal-darwin spec/unit/property/boolean_spec.rb
puppet-5.5.12 spec/unit/property/boolean_spec.rb
puppet-5.5.12-x86-mingw32 spec/unit/property/boolean_spec.rb
puppet-5.5.12-x64-mingw32 spec/unit/property/boolean_spec.rb
puppet-5.5.12-universal-darwin spec/unit/property/boolean_spec.rb
puppet-6.3.0 spec/unit/property/boolean_spec.rb
puppet-6.3.0-x86-mingw32 spec/unit/property/boolean_spec.rb
puppet-6.3.0-x64-mingw32 spec/unit/property/boolean_spec.rb
puppet-6.3.0-universal-darwin spec/unit/property/boolean_spec.rb
puppet-6.2.0 spec/unit/property/boolean_spec.rb
puppet-6.2.0-x86-mingw32 spec/unit/property/boolean_spec.rb
puppet-6.2.0-x64-mingw32 spec/unit/property/boolean_spec.rb
puppet-6.2.0-universal-darwin spec/unit/property/boolean_spec.rb