diff options
author | Matt Wrock <matt@mattwrock.com> | 2016-05-27 17:28:16 -0700 |
---|---|---|
committer | Matt Wrock <matt@mattwrock.com> | 2016-05-27 17:28:16 -0700 |
commit | 6fd05d1bb24d7eab5a38f4dbba9bf108a5f5bd2b (patch) | |
tree | bc22db134e658dc939b00d0cd78eac056fd151ed /spec | |
parent | a3a22771bef2acec5c325751622a47f733ee100c (diff) | |
download | chef-6fd05d1bb24d7eab5a38f4dbba9bf108a5f5bd2b.tar.gz |
fixes #4968 and only retrieves the latest version of packages from chocolateychoco_ar
Diffstat (limited to 'spec')
-rw-r--r-- | spec/functional/resource/chocolatey_package_spec.rb | 5 | ||||
-rw-r--r-- | spec/unit/provider/package/chocolatey_spec.rb | 16 |
2 files changed, 1 insertions, 20 deletions
diff --git a/spec/functional/resource/chocolatey_package_spec.rb b/spec/functional/resource/chocolatey_package_spec.rb index fb51fd2d64..7bb6698daf 100644 --- a/spec/functional/resource/chocolatey_package_spec.rb +++ b/spec/functional/resource/chocolatey_package_spec.rb @@ -82,11 +82,6 @@ describe Chef::Resource::ChocolateyPackage, :windows_only do subject.package_name "blah" expect { subject.run_action(:install) }.to raise_error Chef::Exceptions::Package end - - it "raises if package version is not found" do - subject.version "3.0" - expect { subject.run_action(:install) }.to raise_error Chef::Exceptions::Package - end end context "upgrading a package" do diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb index 8eaa69b598..8344c3d0ec 100644 --- a/spec/unit/provider/package/chocolatey_spec.rb +++ b/spec/unit/provider/package/chocolatey_spec.rb @@ -59,7 +59,7 @@ Git|2.6.2 munin-node|1.6.1.20130823 EOF remote_list_obj = double(stdout: remote_list_stdout) - allow(provider).to receive(:shell_out!).with("#{choco_exe} list -ar #{package_names.join ' '}#{args}", { timeout: timeout }).and_return(remote_list_obj) + allow(provider).to receive(:shell_out!).with("#{choco_exe} list -r #{package_names.join ' '}#{args}", { timeout: timeout }).and_return(remote_list_obj) end describe "#initialize" do @@ -84,12 +84,6 @@ munin-node|1.6.1.20130823 expect(provider.candidate_version).to eql(["2.6.1"]) end - it "should set the candidate_version to nill if pinning to bogus version" do - allow_remote_list(["git"]) - new_resource.version("2.5.0") - expect(provider.candidate_version).to eql([nil]) - end - it "should set the candidate_version to nil if there is no candidate" do allow_remote_list(["vim"]) new_resource.package_name("vim") @@ -301,14 +295,6 @@ munin-node|1.6.1.20130823 expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package) end - it "installing a package version that does not exist throws an error" do - allow_remote_list(["git"]) - new_resource.package_name("git") - new_resource.version("2.7.0") - provider.load_current_resource - expect { provider.run_action(:install) }.to raise_error(Chef::Exceptions::Package) - end - it "installing multiple packages with a package that does not exist throws an error" do allow_remote_list(["git", "package-does-not-exist"]) new_resource.package_name(["git", "package-does-not-exist"]) |