File: test_protocol.rb

package info (click to toggle)
ruby-net-sftp 1%3A2.1.2-3
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 528 kB
  • ctags: 860
  • sloc: ruby: 5,015; makefile: 4
file content (17 lines) | stat: -rw-r--r-- 537 bytes parent folder | download | duplicates (8)
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