diff options
-rw-r--r-- | chef.gemspec | 2 | ||||
-rw-r--r-- | spec/functional/resource/chocolatey_package_spec.rb | 20 |
2 files changed, 20 insertions, 2 deletions
diff --git a/chef.gemspec b/chef.gemspec index e78237b31d..5d35bc2119 100644 --- a/chef.gemspec +++ b/chef.gemspec @@ -23,7 +23,7 @@ Gem::Specification.new do |s| s.add_dependency "mixlib-cli", ">= 2.1.1", "< 3.0" s.add_dependency "mixlib-log", ">= 2.0.3", "< 4.0" s.add_dependency "mixlib-authentication", "~> 2.1" - s.add_dependency "mixlib-shellout", ">= 2.4", "< 4.0" + s.add_dependency "mixlib-shellout", ">= 3.0.3", "< 4.0" s.add_dependency "mixlib-archive", ">= 0.4", "< 2.0" s.add_dependency "ohai", "~> 15.0" diff --git a/spec/functional/resource/chocolatey_package_spec.rb b/spec/functional/resource/chocolatey_package_spec.rb index c5590b2d88..a2728b3fa9 100644 --- a/spec/functional/resource/chocolatey_package_spec.rb +++ b/spec/functional/resource/chocolatey_package_spec.rb @@ -1,6 +1,6 @@ # # Author:: Matt Wrock (<matt@mattwrock.com>) -# Copyright:: Copyright (c) 2016 Chef Software, Inc. +# Copyright:: Copyright (c) 2016-2019, Chef Software Inc. # License:: Apache License, Version 2.0 # # Licensed under the Apache License, Version 2.0 (the "License"); @@ -75,6 +75,24 @@ describe Chef::Resource::ChocolateyPackage, :windows_only, :choco_installed do subject.package_name "blah" expect { subject.run_action(:install) }.to raise_error Chef::Exceptions::Package end + + it "installs with an option as a string" do + subject.options "--force --confirm" + subject.run_action(:install) + expect(package_list.call).to eq("#{package_name}|2.0") + end + + it "installs with multiple options as a string" do + subject.options "--force --confirm" + subject.run_action(:install) + expect(package_list.call).to eq("#{package_name}|2.0") + end + + it "installs with multiple options as an array" do + subject.options [ "--force", "--confirm" ] + subject.run_action(:install) + expect(package_list.call).to eq("#{package_name}|2.0") + end end context "upgrading a package" do |