summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVivek Singh <vivek.singh@msystechnologies.com>2020-07-09 11:30:00 +0530
committerVivek Singh <vivek.singh@msystechnologies.com>2020-07-21 16:47:30 +0530
commit327bb9ec7db817ead4827a9af27a4cae00e9ddc3 (patch)
tree4d1d9b811d74370f8732dc8b20935fa39135a942
parent494ca6525b72a594df39f4c39861b4feb63d85fe (diff)
downloadchef-327bb9ec7db817ead4827a9af27a4cae00e9ddc3.tar.gz
Fix test cases
Signed-off-by: Vivek Singh <vivek.singh@msystechnologies.com>
-rw-r--r--spec/unit/knife/bootstrap_spec.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/spec/unit/knife/bootstrap_spec.rb b/spec/unit/knife/bootstrap_spec.rb
index f19f28cdb2..dc3241436d 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -1864,9 +1864,8 @@ describe Chef::Knife::Bootstrap do
question_mock = double("question")
expect(knife).to receive(:do_connect).and_raise(expected_error_password_prompt)
expect(knife.ui).to receive(:warn).with(/Failed to auth.*/)
- expect(knife.ui).to receive(:ask).and_yield(question_mock).and_return("newpassword")
+ expect(knife.ui).to receive(:ask).and_return("newpassword")
# Ensure that we set echo off to prevent showing password on the screen
- expect(question_mock).to receive(:echo=).with false
expect(knife).to receive(:do_connect) do |opts|
expect(opts[:password]).to eq "newpassword"
end
@@ -1878,12 +1877,10 @@ describe Chef::Knife::Bootstrap do
let(:connection_protocol) { "winrm" }
it "warns, prompts for password, then reconnects with a password-enabled configuration using the new password for" do
- question_mock = double("question")
expect(knife).to receive(:do_connect).and_raise(expected_error_password_prompt_winrm)
expect(knife.ui).to receive(:warn).with(/Failed to auth.*/)
- expect(knife.ui).to receive(:ask).and_yield(question_mock).and_return("newpassword")
+ expect(knife.ui).to receive(:ask).and_return("newpassword")
# Ensure that we set echo off to prevent showing password on the screen
- expect(question_mock).to receive(:echo=).with false
expect(knife).to receive(:do_connect) do |opts|
expect(opts[:password]).to eq "newpassword"
end