summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerdar Sutay <serdar@opscode.com>2014-11-25 11:07:13 -0800
committerSerdar Sutay <serdar@opscode.com>2014-11-25 11:07:13 -0800
commitb7405e0d5cb44472853c7471a7250ede5bb396ae (patch)
treea2100a6b154b0b52de64bc4417abde3b2013b1d0
parent5380ecde5dcda0a3fed3d71d7a89ce58b2e9a552 (diff)
parent659b4101d2ab1a227b5da34bd285a4c449e01eb7 (diff)
downloadchef-b7405e0d5cb44472853c7471a7250ede5bb396ae.tar.gz
Merge branch 'fix_prerelease_parameter' of github.com:Daegalus/chef
-rw-r--r--lib/chef/knife/core/bootstrap_context.rb2
-rw-r--r--spec/unit/knife/core/bootstrap_context_spec.rb14
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/chef/knife/core/bootstrap_context.rb b/lib/chef/knife/core/bootstrap_context.rb
index e681d7a49b..ce062bdd25 100644
--- a/lib/chef/knife/core/bootstrap_context.rb
+++ b/lib/chef/knife/core/bootstrap_context.rb
@@ -135,7 +135,7 @@ CONFIG
def latest_current_chef_version_string
installer_version_string = nil
if @config[:prerelease]
- installer_version_string = "-p"
+ installer_version_string = ["-p"]
else
chef_version_string = if knife_config[:bootstrap_version]
knife_config[:bootstrap_version]
diff --git a/spec/unit/knife/core/bootstrap_context_spec.rb b/spec/unit/knife/core/bootstrap_context_spec.rb
index 1291571358..af8fa3f698 100644
--- a/spec/unit/knife/core/bootstrap_context_spec.rb
+++ b/spec/unit/knife/core/bootstrap_context_spec.rb
@@ -205,4 +205,18 @@ EXPECTED
end
end
+ describe "prerelease" do
+ it "isn't set in the config_content by default" do
+ expect(bootstrap_context.config_content).not_to include("prerelease")
+ end
+
+ describe "when configured via cli" do
+ let(:config) {{:prerelease => true}}
+
+ it "uses CLI value" do
+ expect(bootstrap_context.latest_current_chef_version_string).to eq("-p")
+ end
+ end
+ end
+
end