diff options
| author | delano <delano@solutious.com> | 2010-03-20 14:37:01 -0400 |
|---|---|---|
| committer | delano <delano@solutious.com> | 2010-03-20 14:37:01 -0400 |
| commit | f10dc157c25f1802c3555f271bade8584e50ff7d (patch) | |
| tree | 24c20590b29c78937d77c2ab146b7e6940feb494 /test | |
| parent | 1744a1e3cfeea5af203efe90a182f061b8830f30 (diff) | |
| download | net-ssh-f10dc157c25f1802c3555f271bade8584e50ff7d.tar.gz | |
Fix for "IdentifyFile" in ~/.ssh/config does not work if no "Host" statement is given
Diffstat (limited to 'test')
| -rw-r--r-- | test/configs/nohost | 20 | ||||
| -rw-r--r-- | test/test_config.rb | 6 |
2 files changed, 25 insertions, 1 deletions
diff --git a/test/configs/nohost b/test/configs/nohost index fecdb9e..59204a6 100644 --- a/test/configs/nohost +++ b/test/configs/nohost @@ -1 +1,19 @@ -IdentityFile ~/.ssh/id_dsa
\ No newline at end of file + +IdentityFile ~/.ssh/id_dsa +IdentityFile ~/.ssh/id_rsa +Port 1980 + +Host test.host + Port 1985 + + + + + + + + + + + +
\ No newline at end of file diff --git a/test/test_config.rb b/test/test_config.rb index cb2ef48..37e6eba 100644 --- a/test/test_config.rb +++ b/test/test_config.rb @@ -38,6 +38,12 @@ class TestConfig < Test::Unit::TestCase assert !config.key?(:rekey_limit) end + def test_load_with_no_host + config = Net::SSH::Config.load(config(:nohost), "test.host") + assert_equal %w(~/.ssh/id_dsa ~/.ssh/id_rsa), config['identityfile'] + assert_equal 1985, config['port'] + end + def test_load_with_multiple_hosts config = Net::SSH::Config.load(config(:multihost), "test.host") assert config['compression'] |
