summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamont Granquist <lamont@scriptkiddie.org>2019-09-04 19:13:52 -0700
committerLamont Granquist <lamont@scriptkiddie.org>2019-09-04 19:13:52 -0700
commit0673d904215bf6233644601a1811a44d57d38e93 (patch)
treef5f714929c9ba6cf5063bcff5dea036f1bd0619f
parent97c8d6d7dea84951bcd5f5ff04f4074b05e1facc (diff)
downloadchef-0673d904215bf6233644601a1811a44d57d38e93.tar.gz
bump mixlib-shellout floor and add func testing on options
Signed-off-by: Lamont Granquist <lamont@scriptkiddie.org>
-rw-r--r--chef.gemspec2
-rw-r--r--spec/functional/resource/chocolatey_package_spec.rb20
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