-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update Protocole::V06::Extended test
- Loading branch information
Nabil BENDAFI
committed
Apr 5, 2017
1 parent
5414bd7
commit c384814
Showing
1 changed file
with
8 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" % version)::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 |