summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSalim Alam <salam@chef.io>2016-04-06 22:09:59 -0700
committerSalim Alam <salam@chef.io>2016-04-06 22:09:59 -0700
commitf52259d38646a50b96605a0700e96be36672eca0 (patch)
tree5bd161124dac5edf4859a10e62644d734652c5e6 /spec
parentcf61f3a9ab6e545735492d72cf1db4c36d6e6cd7 (diff)
downloadchef-f52259d38646a50b96605a0700e96be36672eca0.tar.gz
Diffstat (limited to 'spec')
-rw-r--r--spec/unit/knife/ssh_spec.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/spec/unit/knife/ssh_spec.rb b/spec/unit/knife/ssh_spec.rb
index 65cc5a97b4..44a133d858 100644
--- a/spec/unit/knife/ssh_spec.rb
+++ b/spec/unit/knife/ssh_spec.rb
@@ -203,8 +203,14 @@ describe Chef::Knife::Ssh do
expect(@knife.session.servers[0].port).to eq(123)
end
+ it "defaults to a timeout of 120 seconds" do
+ @knife.session_from_list([["the.b.org", nil]])
+ expect(@knife.session.servers[0].options[:timeout]).to eq(120)
+ end
+
it "uses the timeout from Chef Config" do
Chef::Config[:knife][:ssh_timeout] = 5
+ @knife.config[:ssh_timeout] = nil
@knife.session_from_list([["the.b.org", nil]])
expect(@knife.session.servers[0].options[:timeout]).to eq(5)
end
@@ -215,11 +221,6 @@ describe Chef::Knife::Ssh do
expect(@knife.session.servers[0].options[:timeout]).to eq(6)
end
- it "defaults to no timeout" do
- @knife.session_from_list([["the.b.org", nil]])
- expect(@knife.session.servers[0].options[:timeout]).to eq(nil)
- end
-
it "uses the user from an ssh config file" do
@knife.session_from_list([["the.b.org", 123]])
expect(@knife.session.servers[0].user).to eq("locutus")