File: test_known_hosts.rb

package info (click to toggle)
ruby-net-ssh 1%3A2.5.2-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 1,252 kB
  • sloc: ruby: 12,000; makefile: 2
file content (13 lines) | stat: -rw-r--r-- 372 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
require 'common'

class TestKnownHosts < Test::Unit::TestCase

  def test_key_for_when_all_hosts_are_recognized
    source = File.join(File.dirname(__FILE__),"known_hosts/github")
    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 if RUBY_VERSION > '1.9'

end