Import Net::SSH::Test::Channel code from net-sftp:
This class is included in net-ssh, but net-sftp adds some new methods that we need for our tests. This code resides in net-sftp test helper, and can't be required dynamicaly, this change adds a copy of the code we need, hardcoded in NetSSHStoryHelpers.
This commit is contained in:
parent
b2dbd60830
commit
0529fab3c2
@ -2,6 +2,24 @@ module NetSSHStoryHelpers
|
|||||||
require 'net/ssh/test'
|
require 'net/ssh/test'
|
||||||
include Net::SSH::Test
|
include Net::SSH::Test
|
||||||
|
|
||||||
|
# FIXME: must be moved elsewhere or implemented another way/form.
|
||||||
|
class ::Net::SSH::Test::Channel
|
||||||
|
def gets_packet(type, *args)
|
||||||
|
gets_data(sftp_packet(type, *args))
|
||||||
|
end
|
||||||
|
|
||||||
|
def sends_packet(type, *args)
|
||||||
|
sends_data(sftp_packet(type, *args))
|
||||||
|
end
|
||||||
|
|
||||||
|
private
|
||||||
|
|
||||||
|
def sftp_packet(type, *args)
|
||||||
|
data = Net::SSH::Buffer.from(*args)
|
||||||
|
Net::SSH::Buffer.from(:long, data.length + 1, :byte, type, :raw, data).to_s
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
def story_with_new_channel
|
def story_with_new_channel
|
||||||
story do |session|
|
story do |session|
|
||||||
ch = session.opens_channel
|
ch = session.opens_channel
|
||||||
|
Loading…
x
Reference in New Issue
Block a user