Skip to content

Commit

Permalink
Update Protocole::V06::Extended test
Browse files Browse the repository at this point in the history
  • Loading branch information
Nabil BENDAFI committed Apr 5, 2017
1 parent 5414bd7 commit b0778ce
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/test_protocol.rb
Original file line number Diff line number Diff line change
@@ -1,17 +1,23 @@
require 'common'

class ProtocolTest < Net::SFTP::TestCase
1.upto(6) do |version|
1.upto(5) 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_6_should_return_v6_driver
session = stub('session', :logger => nil)
driver = Net::SFTP::Protocol.load(session, 6)
assert_instance_of Net::SFTP::Protocol.const_get("V06")::Extended, driver
end

def test_load_version_7_should_be_unsupported
assert_raises(NotImplementedError) do
Net::SFTP::Protocol.load(stub('session'), 7)
end
end
end
end

0 comments on commit b0778ce

Please sign in to comment.