diff options
author | Jamis Buck <jamis@37signals.com> | 2007-08-26 04:03:39 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2007-08-26 04:03:39 +0000 |
commit | aaa563330f8c11078ff007c769406740a1ecf875 (patch) | |
tree | 72568db1fb0fb1dde0bd962f3a088c52980846bf /lib/net/ssh/test/script.rb | |
parent | 952d84d8e1b9a85e870f017a034481b5d40d3523 (diff) | |
download | net-ssh-aaa563330f8c11078ff007c769406740a1ecf875.tar.gz |
more tweaks to the testing module
git-svn-id: http://svn.jamisbuck.org/net-ssh/branches/v2@208 1d2a57f2-1ded-0310-ad52-83097a15a5de
Diffstat (limited to 'lib/net/ssh/test/script.rb')
-rw-r--r-- | lib/net/ssh/test/script.rb | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/net/ssh/test/script.rb b/lib/net/ssh/test/script.rb index 9be2617..69b5d92 100644 --- a/lib/net/ssh/test/script.rb +++ b/lib/net/ssh/test/script.rb @@ -11,12 +11,16 @@ module Net; module SSH; module Test @events = [] end - def opens_channel + def opens_channel(confirm=true) channel = Channel.new(self) channel.remote_id = 5555 events << LocalPacket.new(:channel_open) { |p| channel.local_id = p[:remote_id] } - events << RemotePacket.new(:channel_open_confirmation, channel.local_id, channel.remote_id, 0x20000, 0x10000) + + if confirm + events << RemotePacket.new(:channel_open_confirmation, channel.local_id, channel.remote_id, 0x20000, 0x10000) + end + channel end @@ -72,7 +76,7 @@ module Net; module SSH; module Test end def process(packet) - event = events.shift or raise "end of script reached, but got a packet type #{packet.type}" + event = events.shift or raise "end of script reached, but got a packet type #{packet.read_byte}" event.process(packet) end end |