diff options
author | Miklós Fazekas <mfazekas@szemafor.com> | 2021-08-05 12:25:58 +0200 |
---|---|---|
committer | Miklós Fazekas <mfazekas@szemafor.com> | 2021-08-05 12:25:58 +0200 |
commit | a20d1ba7f524eb3aa4a1e4a30b2cf94c9d47581f (patch) | |
tree | 2c80aa8636a36fa1776ecf10204d841142b9ead6 | |
parent | 5bb3618cbfb56521d51c4bc6cec104d6ccd12bfc (diff) | |
download | net-ssh-a20d1ba7f524eb3aa4a1e4a30b2cf94c9d47581f.tar.gz |
test_algorithm should not depeng on known host file contents
-rw-r--r-- | test/transport/test_algorithms.rb | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/test/transport/test_algorithms.rb b/test/transport/test_algorithms.rb index d79d446..d998d56 100644 --- a/test/transport/test_algorithms.rb +++ b/test/transport/test_algorithms.rb @@ -46,7 +46,9 @@ module Transport end def test_constructor_with_known_hosts_reporting_known_host_key_should_use_that_host_key_type - Net::SSH::KnownHosts.expects(:search_for).with("net.ssh.test,127.0.0.1", {}).returns([stub("key", ssh_type: "ssh-dss")]) + Net::SSH::KnownHosts.expects(:search_for).with("net.ssh.test,127.0.0.1", { + user_known_hosts_file: "/dev/null", global_known_hosts_file: "/dev/null" + }).returns([stub("key", ssh_type: "ssh-dss")]) assert_equal %w[ssh-dss] + ed_ec_host_keys + %w[ssh-rsa-cert-v01@openssh.com ssh-rsa-cert-v00@openssh.com ssh-rsa rsa-sha2-256 rsa-sha2-512], algorithms[:host_key] end @@ -438,7 +440,10 @@ module Transport end def transport(transport_options={}) - @transport ||= MockTransport.new(transport_options) + @transport ||= MockTransport.new( + {user_known_hosts_file: '/dev/null', + global_known_hosts_file: '/dev/null'}.merge(transport_options) + ) end end end |