Refactor Net::SSH spec helpers definition and usages
This commit is contained in:
17
spec/support/net_ssh_story_helpers.rb
Normal file
17
spec/support/net_ssh_story_helpers.rb
Normal file
@@ -0,0 +1,17 @@
|
||||
module NetSSHStoryHelpers
|
||||
require 'net/ssh/test'
|
||||
include Net::SSH::Test
|
||||
|
||||
def story_with_new_channel
|
||||
story do |session|
|
||||
ch = session.opens_channel
|
||||
yield ch
|
||||
ch.gets_close
|
||||
ch.sends_close
|
||||
end
|
||||
end
|
||||
|
||||
def story_completed?
|
||||
socket.script.events.empty?
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user