summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-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 ede8d029c6..294942c229 100644
--- a/spec/unit/knife/bootstrap_spec.rb
+++ b/spec/unit/knife/bootstrap_spec.rb
@@ -1763,7 +1763,6 @@ describe Chef::Knife::Bootstrap do
let(:exit_status) { 1 }
let(:stdout) { "su: Authentication failure" }
let(:connection_obj) { double("connection", transport_options: {}) }
- let(:result_mock2) { double("result", exit_status: 1, stderr: "A message", stdout: "") }
it "shows an error and exits" do
allow(connection).to receive(:connection).and_return(connection_obj)
expect(knife.ui).to receive(:info).with(/Bootstrapping.*/)
@@ -1774,10 +1773,8 @@ describe Chef::Knife::Bootstrap do
.to receive(:run_command)
.with("su - USER -c 'sh /path.sh'")
.and_yield("output here", nil)
- .and_return result_mock
- expect(knife.ui).to receive(:ask).and_return("password").twice
- expect(connection).to receive(:run_command).with("su - USER -c 'sh /path.sh'").and_return(result_mock, result_mock2)
- expect { knife.perform_bootstrap("/path.sh") }.to raise_error(SystemExit)
+ .and_raise(Train::UserError)
+ expect { knife.perform_bootstrap("/path.sh") }.to raise_error(Train::UserError)
end
end
end