Sha256: b7b4c083b9596a714f897d7d219c3632b5b2fe4cef67fd01920863f30af9b773

Contents?: true

Size: 2 KB

Versions: 8

Compression:

Stored size: 2 KB

Contents

require_relative "../../../../base"

require Vagrant.source_root.join("plugins/provisioners/chef/config/base")

describe VagrantPlugins::Chef::Config::Base do
  include_context "unit"

  subject { described_class.new }

  let(:machine) { double("machine") }

  describe "#binary_path" do
    it "defaults to nil" do
      subject.finalize!
      expect(subject.binary_path).to be(nil)
    end
  end

  describe "#binary_env" do
    it "defaults to nil" do
      subject.finalize!
      expect(subject.binary_env).to be(nil)
    end
  end

  describe "#product" do
    it "defaults to \"chef\"" do
      subject.finalize!
      expect(subject.product).to eq("chef")
    end
  end

  describe "#install" do
    it "defaults to true" do
      subject.finalize!
      expect(subject.install).to be(true)
    end

    it "is converted to a symbol" do
      subject.install = "force"
      subject.finalize!
      expect(subject.install).to eq(:force)
    end
  end

  describe "#log_level" do
    it "defaults to :info" do
      subject.finalize!
      expect(subject.log_level).to be(:info)
    end

    it "is converted to a symbol" do
      subject.log_level = "foo"
      subject.finalize!
      expect(subject.log_level).to eq(:foo)
    end
  end

  describe "#channel" do
    it "defaults to \"stable\"" do
      subject.finalize!
      expect(subject.channel).to eq("stable")
    end
  end

  describe "#prerelease" do
    it "should not exist in Vagrant 1.9" do
      if Vagrant::VERSION >= "1.9"
        raise "This option should be removed!"
      end
    end
  end

  describe "#version" do
    it "defaults to :latest" do
      subject.finalize!
      expect(subject.version).to eq(:latest)
    end

    it "converts the string 'latest' to a symbol" do
      subject.version = "latest"
      subject.finalize!
      expect(subject.version).to eq(:latest)
    end
  end

  describe "#installer_download_path" do
    it "defaults to nil" do
      subject.finalize!
      expect(subject.installer_download_path).to be(nil)
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/provisioners/chef/config/base_test.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/provisioners/chef/config/base_test.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/provisioners/chef/config/base_test.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/bundler/gems/vagrant-dbb756c7b6da/test/unit/plugins/provisioners/chef/config/base_test.rb
vagrant-unbundled-1.8.5.2 test/unit/plugins/provisioners/chef/config/base_test.rb
vagrant-unbundled-1.8.5.1 test/unit/plugins/provisioners/chef/config/base_test.rb
vagrant-unbundled-1.8.4.2 test/unit/plugins/provisioners/chef/config/base_test.rb
vagrant-unbundled-1.8.4.1 test/unit/plugins/provisioners/chef/config/base_test.rb