Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'msgehard_master' of https://github.com/msgehard/capistrano

 into msgehard-msgehard_master

* 'msgehard_master' of https://github.com/msgehard/capistrano:
  If you set an level of verboseness on cap, Net::SSH will set verboseness to debug.
  • Loading branch information...
commit 27d62a197c77916894da6ae4cdd1a075df1d06f6 2 parents a69d76d + 97e4328
@leehambley leehambley authored
Showing with 11 additions and 0 deletions.
  1. +2 −0  lib/capistrano/ssh.rb
  2. +9 −0 test/ssh_test.rb
View
2  lib/capistrano/ssh.rb
@@ -69,6 +69,8 @@ def self.connection_strategy(server, options={}, &block)
# Once we've loaded the config, we don't need Net::SSH to do it again.
ssh_options[:config] = false
+ ssh_options[:verbose] = :debug if options[:verbose] && options[:verbose] > 0
+
user = server.user || options[:user] || ssh_options[:username] ||
ssh_options[:user] || ServerDefinition.default_user
port = server.port || options[:port] || ssh_options[:port]
View
9 test/ssh_test.rb
@@ -82,6 +82,15 @@ def test_connect_with_options_and_ssh_options_should_see_options_override_ssh_op
assert_equal success, Capistrano::SSH.connect(@server, :ssh_options => ssh_options, :user => "jamis", :port => 1235)
end
+ def test_connect_with_verbose_option_should_set_verbose_option_on_ssh
+ Net::SSH.expects(:start).with(@server.host, "default-user", @options).returns(success = Object.new)
+ assert_equal success, Capistrano::SSH.connect(@server, :verbose => 0)
+ Net::SSH.expects(:start).with(@server.host, "default-user", @options.merge(:verbose => :debug)).returns(success = Object.new)
+ assert_equal success, Capistrano::SSH.connect(@server, :verbose => 1)
+ Net::SSH.expects(:start).with(@server.host, "default-user", @options.merge(:verbose => :debug)).returns(success = Object.new)
+ assert_equal success, Capistrano::SSH.connect(@server, :verbose => 2)
+ end
+
def test_connect_with_ssh_options_should_see_server_options_override_ssh_options
ssh_options = { :username => "JamisMan", :port => 8125, :forward_agent => true }
server = server("jamis@capistrano:1235")
Please sign in to comment.
Something went wrong with that request. Please try again.