Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Ensure a config object is passed down in the update action #1254

Merged
merged 1 commit into from
May 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/chef-dk/command/update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/command/install_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions spec/unit/command/update_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down