diff --git a/lib/chef-dk/command/update.rb b/lib/chef-dk/command/update.rb index f43f4bbd7..6c560a076 100644 --- a/lib/chef-dk/command/update.rb +++ b/lib/chef-dk/command/update.rb @@ -101,7 +101,7 @@ def run(params = []) end def installer - @installer ||= PolicyfileServices::Install.new(policyfile: policyfile_relative_path, ui: ui, root_dir: Dir.pwd, overwrite: true) + @installer ||= PolicyfileServices::Install.new(policyfile: policyfile_relative_path, ui: ui, root_dir: Dir.pwd, config: chef_config, overwrite: true) end def attributes_updater diff --git a/spec/unit/command/install_spec.rb b/spec/unit/command/install_spec.rb index 77216ff25..5aaede60a 100644 --- a/spec/unit/command/install_spec.rb +++ b/spec/unit/command/install_spec.rb @@ -78,7 +78,7 @@ it "creates the installer service with a `nil` policyfile path" do expect(ChefDK::PolicyfileServices::Install).to receive(:new). - with(hash_including(policyfile: nil, ui: command.ui, root_dir: Dir.pwd)). + with(hash_including(policyfile: nil, ui: command.ui, root_dir: Dir.pwd, config: Chef::Config)). and_return(install_service) expect(command.installer).to eq(install_service) end @@ -95,7 +95,7 @@ it "creates the installer service with the specified policyfile path" do expect(ChefDK::PolicyfileServices::Install).to receive(:new). - with(hash_including(policyfile: "MyPolicy.rb", ui: command.ui, root_dir: Dir.pwd)). + with(hash_including(policyfile: "MyPolicy.rb", ui: command.ui, root_dir: Dir.pwd, config: Chef::Config)). and_return(install_service) expect(command.installer).to eq(install_service) end diff --git a/spec/unit/command/update_spec.rb b/spec/unit/command/update_spec.rb index b65bb21b0..f182a3633 100644 --- a/spec/unit/command/update_spec.rb +++ b/spec/unit/command/update_spec.rb @@ -96,7 +96,7 @@ it "creates the installer service with a `nil` policyfile path" do expect(ChefDK::PolicyfileServices::Install).to receive(:new). - with(policyfile: nil, ui: command.ui, root_dir: Dir.pwd, overwrite: true). + with(policyfile: nil, ui: command.ui, root_dir: Dir.pwd, config: Chef::Config, overwrite: true). and_return(install_service) expect(command.installer).to eq(install_service) end @@ -113,7 +113,7 @@ it "creates the installer service with the specified policyfile path" do expect(ChefDK::PolicyfileServices::Install).to receive(:new). - with(policyfile: "MyPolicy.rb", ui: command.ui, root_dir: Dir.pwd, overwrite: true). + with(policyfile: "MyPolicy.rb", ui: command.ui, root_dir: Dir.pwd, config: Chef::Config, overwrite: true). and_return(install_service) expect(command.installer).to eq(install_service) end