public
Description: Pure Ruby implementation of an SFTP (protocols 1-6) client
Homepage: http://rubyforge.org/projects/net-ssh
Clone URL: git://github.com/jamis/net-sftp.git
net-sftp / test / test_protocol.rb
100644 17 lines (15 sloc) 0.537 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
require 'common'
 
class ProtocolTest < Net::SFTP::TestCase
  1.upto(6) do |version|
    define_method("test_load_version_#{version}_should_return_v#{version}_driver") do
      session = stub('session', :logger => nil)
      driver = Net::SFTP::Protocol.load(session, version)
      assert_instance_of Net::SFTP::Protocol.const_get("V%02d" % version)::Base, driver
    end
  end
 
  def test_load_version_7_should_be_unsupported
    assert_raises(NotImplementedError) do
      Net::SFTP::Protocol.load(stub('session'), 7)
    end
  end
end