diff options
author | tyler-ball <tyleraball@gmail.com> | 2014-11-25 14:45:10 -0800 |
---|---|---|
committer | tyler-ball <tyleraball@gmail.com> | 2014-11-25 14:45:10 -0800 |
commit | 2e3ea9d76d4b8e912ff88b22b9cb29b9c8d9009c (patch) | |
tree | 70c0ccd28fab446b92a5db0ce6797fcfd49f7e2a /spec | |
parent | 2cabf9c5ba969ff89128d5334e36a76c766fce93 (diff) | |
parent | 5bab29b02248a4468a7fbf7f6226c30255c3abe3 (diff) | |
download | chef-2e3ea9d76d4b8e912ff88b22b9cb29b9c8d9009c.tar.gz |
Merge branch 'master' into tball/contrib-pass
Conflicts:
CHANGELOG.md
Diffstat (limited to 'spec')
-rw-r--r-- | spec/unit/config_spec.rb | 4 | ||||
-rw-r--r-- | spec/unit/knife/core/bootstrap_context_spec.rb | 14 | ||||
-rw-r--r-- | spec/unit/provider/package/rubygems_spec.rb | 8 |
3 files changed, 24 insertions, 2 deletions
diff --git a/spec/unit/config_spec.rb b/spec/unit/config_spec.rb index 58fb229c96..ed2003e8bf 100644 --- a/spec/unit/config_spec.rb +++ b/spec/unit/config_spec.rb @@ -426,7 +426,7 @@ describe Chef::Config do let(:locales) { locale_array.join("\n") } before do - allow(Chef::Config).to receive(:shell_out_with_systems_locale).with("locale -a").and_return(shell_out) + allow(Chef::Config).to receive(:shell_out_with_systems_locale!).with("locale -a").and_return(shell_out) end shared_examples_for "a suitable locale" do @@ -493,7 +493,7 @@ describe Chef::Config do let(:locale_array) { [] } before do - allow(Chef::Config).to receive(:shell_out_with_systems_locale).and_raise("THIS IS AN ERROR") + allow(Chef::Config).to receive(:shell_out_with_systems_locale!).and_raise("THIS IS AN ERROR") end it "should default to 'en_US.UTF-8'" do 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 diff --git a/spec/unit/provider/package/rubygems_spec.rb b/spec/unit/provider/package/rubygems_spec.rb index a3a4772229..b4960b2af3 100644 --- a/spec/unit/provider/package/rubygems_spec.rb +++ b/spec/unit/provider/package/rubygems_spec.rb @@ -536,6 +536,14 @@ describe Chef::Provider::Package::Rubygems do expect(@provider.action_install).to be_truthy end + it "installs the gem by shelling out when options are provided but no version is given" do + @new_resource.options('-i /alt/install/location') + @new_resource.version('') + expected ="gem install \"rspec-core\" -q --no-rdoc --no-ri -i /alt/install/location" + expect(@provider).to receive(:shell_out!).with(expected, :env => nil) + expect(@provider.action_install).to be_truthy + end + it "installs the gem via the gems api when options are given as a Hash" do @new_resource.options(:install_dir => '/alt/install/location') expect(@provider.gem_env).to receive(:install).with(@gem_dep, :sources => nil, :install_dir => '/alt/install/location') |