Sha256: 71e174ebd7616ac1f6f3ca3782c758efa3f210fef623a5d90360bd92d9ee46e4

Contents?: true

Size: 514 Bytes

Versions: 22

Compression:

Stored size: 514 Bytes

Contents

require 'common'

class TestKnownHosts < Test::Unit::TestCase

  def perform_test(hostfile)
    source = File.join(File.dirname(__FILE__), hostfile)
    kh = Net::SSH::KnownHosts.new(source)
    keys = kh.keys_for("github.com")
    assert_equal(1, keys.count)
    assert_equal("ssh-rsa", keys[0].ssh_type)
  end

  def test_key_for_when_all_hosts_are_recognized
    perform_test("known_hosts/github")
  end

  def test_key_for_when_an_host_hash_is_recognized
    perform_test("known_hosts/github_hash")
  end

end

Version data entries

22 entries across 22 versions & 4 rubygems

Version Path
vagrant-unbundled-1.9.1.1 vendor/bundle/ruby/2.4.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
vagrant-compose-yaml-0.1.3 vendor/bundle/ruby/2.2.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
vagrant-compose-yaml-0.1.2 vendor/bundle/ruby/2.2.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
vagrant-compose-yaml-0.1.1 vendor/bundle/ruby/2.2.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
vagrant-compose-yaml-0.1.0 vendor/bundle/ruby/2.2.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
vagrant-unbundled-1.8.5.2 vendor/bundle/ruby/2.3.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
vagrant-unbundled-1.8.5.1 vendor/bundle/ruby/2.3.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
vagrant-unbundled-1.8.4.2 vendor/bundle/ruby/2.3.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
vagrant-unbundled-1.8.4.1 vendor/bundle/ruby/2.3.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
net-ssh-3.1.0.rc1 test/test_known_hosts.rb
net-ssh-3.1.0.beta3 test/test_known_hosts.rb
net-ssh-3.1.0.beta2 test/test_known_hosts.rb
vagrant-unbundled-1.8.1.1 vendor/bundle/ruby/2.3.0/gems/net-ssh-3.0.2/test/test_known_hosts.rb
net-ssh-3.0.2 test/test_known_hosts.rb
net-ssh-3.0.2.rc1 test/test_known_hosts.rb
sc_core-0.0.7 test/dummy/vendor/bundle/ruby/2.2.0/gems/net-ssh-3.0.1/test/test_known_hosts.rb
net-ssh-3.0.1 test/test_known_hosts.rb
net-ssh-3.0.1.rc1 test/test_known_hosts.rb
net-ssh-3.0.0.rc1 test/test_known_hosts.rb
net-ssh-2.10.1.rc2 test/test_known_hosts.rb