Sha256: ce16604a1c71d835a67231a366230e6098c2fb90855b0e2b808391c9b4e95b9d

Contents?: true

Size: 709 Bytes

Versions: 92

Compression:

Stored size: 709 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'

describe Puppet::Settings::TerminusSetting do
  let(:setting) { described_class.new(:settings => mock('settings'), :desc => "test") }

  describe "#munge" do
    it "converts strings to symbols" do
      setting.munge("string").should == :string
    end

    it "converts '' to nil" do
      setting.munge('').should be_nil
    end

    it "preserves symbols" do
      setting.munge(:symbol).should == :symbol
    end

    it "preserves nil" do
      setting.munge(nil).should be_nil
    end

    it "does not allow unknown types through" do
      expect { setting.munge(["not a terminus type"]) }.to raise_error Puppet::Settings::ValidationError
    end
  end
end

Version data entries

92 entries across 92 versions & 2 rubygems

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