summaryrefslogtreecommitdiff
path: root/spec/unit/knife
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2019-08-29 12:15:31 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2019-08-29 12:15:31 +0530
commit3d5abb8793042dd065743dda62a936934dc63d11 (patch)
treeb7b453b0985c64de49a9f38e7dfcb78c19e16bfa /spec/unit/knife
parent75234876e5dada09707f2b8d04d5c968e905b364 (diff)
downloadchef-3d5abb8793042dd065743dda62a936934dc63d11.tar.gz
Change ownership only for non-sudo user
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
Diffstat (limited to 'spec/unit/knife')
-rw-r--r--spec/unit/knife/bootstrap/train_connector_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/unit/knife/bootstrap/train_connector_spec.rb b/spec/unit/knife/bootstrap/train_connector_spec.rb
index 83a18cb6ca..bb6d21875f 100644
--- a/spec/unit/knife/bootstrap/train_connector_spec.rb
+++ b/spec/unit/knife/bootstrap/train_connector_spec.rb
@@ -172,7 +172,7 @@ describe Chef::Knife::Bootstrap::TrainConnector do
end
it "without sudo privilege" do
- expected_command = "mkdir -p #{dir} && chown user1 '#{dir}'"
+ expected_command = "mkdir -p #{dir}"
expect(subject).to receive(:run_command!).with(expected_command)
.and_return double("result", stdout: "\r\n")
expect(subject.temp_dir).to eq(dir)
@@ -180,8 +180,8 @@ describe Chef::Knife::Bootstrap::TrainConnector do
end
context "with noise in stderr" do
- it "uses the *nix command to create the temp dir and sets ownership to logged-in user" do
- expected_command = "mkdir -p #{dir} && chown user1 '#{dir}'"
+ it "uses the *nix command to create the temp dir" do
+ expected_command = "mkdir -p #{dir}"
expect(subject).to receive(:run_command!).with(expected_command)
.and_return double("result", stdout: "sudo: unable to resolve host hostname.localhost\r\n" + "#{dir}\r\n")
expect(subject.temp_dir).to eq(dir)