diff options
author | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-02-12 17:47:12 +0530 |
---|---|---|
committer | Vivek Singh <vivek.singh@msystechnologies.com> | 2019-02-12 17:47:12 +0530 |
commit | 661bb89cad49656711cac0ee40003b4856f999dc (patch) | |
tree | 06b40dd4cb16c94835287f4c709b24c7e57dd56f | |
parent | ab964df45ad41621a2133a30de113a4cddacaca2 (diff) | |
download | chef-661bb89cad49656711cac0ee40003b4856f999dc.tar.gz |
Authentication on chocolatey_package
- Add missing options cmd args while fetching choco list.
- Fixed rspec.
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r-- | lib/chef/provider/package/chocolatey.rb | 2 | ||||
-rw-r--r-- | spec/unit/provider/package/chocolatey_spec.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/lib/chef/provider/package/chocolatey.rb b/lib/chef/provider/package/chocolatey.rb index 20831ac891..773587dc2e 100644 --- a/lib/chef/provider/package/chocolatey.rb +++ b/lib/chef/provider/package/chocolatey.rb @@ -236,6 +236,8 @@ class Chef begin cmd = [ "list -r #{pkg}" ] cmd.push( "-source #{new_resource.source}" ) if new_resource.source + cmd.push( new_resource.options ) if new_resource.options + raw = parse_list_output(*cmd) raw.keys.each_with_object({}) do |name, available| available[name] = desired_name_versions[name] || raw[name] diff --git a/spec/unit/provider/package/chocolatey_spec.rb b/spec/unit/provider/package/chocolatey_spec.rb index 48f8a562de..0b504b9a35 100644 --- a/spec/unit/provider/package/chocolatey_spec.rb +++ b/spec/unit/provider/package/chocolatey_spec.rb @@ -282,7 +282,7 @@ describe Chef::Provider::Package::Chocolatey do end it "should pass options into the install command" do - allow_remote_list(["git"]) + allow_remote_list(["git"], " -force") new_resource.options("-force") provider.load_current_resource expect(provider).to receive(:shell_out_compacted!).with("#{choco_exe} install -y -force git", { returns: [0], timeout: timeout }).and_return(double) |