extend the Chef provisioner base config object with an 'installer_download_path' property

This commit is contained in:
Torben Knerr 2014-12-16 22:40:19 +01:00
parent 2785fd14db
commit 9e7f705bad
2 changed files with 17 additions and 0 deletions

View File

@ -48,6 +48,14 @@ module VagrantPlugins
# @return [String]
attr_accessor :version
# The path where the Chef installer will be downloaded to. Only valid if
# install is true or "force". It defaults to nil, which means that the
# omnibus installer will choose the destination and you have no control
# over it.
#
# @return [String]
attr_accessor :installer_download_path
def initialize
super
@ -57,6 +65,7 @@ module VagrantPlugins
@log_level = UNSET_VALUE
@prerelease = UNSET_VALUE
@version = UNSET_VALUE
@installer_download_path = UNSET_VALUE
end
def finalize!
@ -66,6 +75,7 @@ module VagrantPlugins
@log_level = :info if @log_level == UNSET_VALUE
@prerelease = false if @prerelease == UNSET_VALUE
@version = :latest if @version == UNSET_VALUE
@installer_download_path = nil if @installer_download_path == UNSET_VALUE
# Make sure the install is a symbol if it's not a boolean
if @install.respond_to?(:to_sym)

View File

@ -68,4 +68,11 @@ describe VagrantPlugins::Chef::Config::Base do
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