diff options
Diffstat (limited to 'lib/net/ssh/test')
-rw-r--r-- | lib/net/ssh/test/channel.rb | 4 | ||||
-rw-r--r-- | lib/net/ssh/test/extensions.rb | 4 | ||||
-rw-r--r-- | lib/net/ssh/test/kex.rb | 4 | ||||
-rw-r--r-- | lib/net/ssh/test/local_packet.rb | 20 | ||||
-rw-r--r-- | lib/net/ssh/test/packet.rb | 7 | ||||
-rw-r--r-- | lib/net/ssh/test/remote_packet.rb | 4 | ||||
-rw-r--r-- | lib/net/ssh/test/script.rb | 4 | ||||
-rw-r--r-- | lib/net/ssh/test/socket.rb | 4 |
8 files changed, 33 insertions, 18 deletions
diff --git a/lib/net/ssh/test/channel.rb b/lib/net/ssh/test/channel.rb index 8676f55..ea17019 100644 --- a/lib/net/ssh/test/channel.rb +++ b/lib/net/ssh/test/channel.rb @@ -144,4 +144,6 @@ module Net end end -end; end; end
\ No newline at end of file + end + end +end
\ No newline at end of file diff --git a/lib/net/ssh/test/extensions.rb b/lib/net/ssh/test/extensions.rb index b52323c..a51114f 100644 --- a/lib/net/ssh/test/extensions.rb +++ b/lib/net/ssh/test/extensions.rb @@ -161,7 +161,9 @@ module Net end end -end; end; end + end + end +end Net::SSH::BufferedIo.send(:include, Net::SSH::Test::Extensions::BufferedIo) Net::SSH::Transport::PacketStream.send(:include, Net::SSH::Test::Extensions::PacketStream) diff --git a/lib/net/ssh/test/kex.rb b/lib/net/ssh/test/kex.rb index 8d96eb4..415f841 100644 --- a/lib/net/ssh/test/kex.rb +++ b/lib/net/ssh/test/kex.rb @@ -40,7 +40,9 @@ module Net end end -end; end; end + end + end +end Net::SSH::Transport::Algorithms::ALGORITHMS[:kex] << "test" Net::SSH::Transport::Kex::MAP["test"] = Net::SSH::Test::Kex diff --git a/lib/net/ssh/test/local_packet.rb b/lib/net/ssh/test/local_packet.rb index f6ac627..998edb7 100644 --- a/lib/net/ssh/test/local_packet.rb +++ b/lib/net/ssh/test/local_packet.rb @@ -1,8 +1,8 @@ require 'net/ssh/packet' require 'net/ssh/test/packet' -module Net - module SSH +module Net + module SSH module Test # This is a specialization of Net::SSH::Test::Packet for representing mock @@ -11,7 +11,7 @@ module Net # of the sends_* methods. class LocalPacket < Packet attr_reader :init - + # Extend the default Net::SSH::Test::Packet constructor to also accept an # optional block, which is used to finalize the initialization of the # packet when #process is first called. @@ -19,12 +19,12 @@ module Net super(type, *args) @init = block end - + # Returns +true+; this is a local packet. def local? true end - + # Called by Net::SSH::Test::Extensions::PacketStream#test_enqueue_packet # to mimic remote processing of a locally-sent packet. It compares the # packet it was given with the contents of this LocalPacket's data, to see @@ -34,15 +34,15 @@ module Net @init.call(Net::SSH::Packet.new(packet.to_s)) if @init type = packet.read_byte raise "expected #{@type}, but got #{type}" if @type != type - + @data.zip(types).each do |expected, _type| _type ||= case expected when nil then break when Numeric then :long when String then :string when TrueClass, FalseClass then :bool - end - + end + actual = packet.send("read_#{_type}") next if expected.nil? raise "expected #{_type} #{expected.inspect} but got #{actual.inspect}" unless expected == actual @@ -50,4 +50,6 @@ module Net end end -end; end; end
\ No newline at end of file + end + end +end diff --git a/lib/net/ssh/test/packet.rb b/lib/net/ssh/test/packet.rb index ad4a334..8d7dc8c 100644 --- a/lib/net/ssh/test/packet.rb +++ b/lib/net/ssh/test/packet.rb @@ -93,8 +93,9 @@ module Net parts.concat(request[:extra_parts]) end else raise "don't know how to parse packet type #{@type}" - end + end end end - -end; end; end + end + end +end diff --git a/lib/net/ssh/test/remote_packet.rb b/lib/net/ssh/test/remote_packet.rb index a3d3c05..90f6008 100644 --- a/lib/net/ssh/test/remote_packet.rb +++ b/lib/net/ssh/test/remote_packet.rb @@ -37,4 +37,6 @@ module Net end end -end; end; end
\ No newline at end of file + end + end +end
\ No newline at end of file diff --git a/lib/net/ssh/test/script.rb b/lib/net/ssh/test/script.rb index 20fa78e..4c51a7d 100644 --- a/lib/net/ssh/test/script.rb +++ b/lib/net/ssh/test/script.rb @@ -177,4 +177,6 @@ module Net end end -end; end; end
\ No newline at end of file + end + end +end
\ No newline at end of file diff --git a/lib/net/ssh/test/socket.rb b/lib/net/ssh/test/socket.rb index 003981d..57fe8f6 100644 --- a/lib/net/ssh/test/socket.rb +++ b/lib/net/ssh/test/socket.rb @@ -63,4 +63,6 @@ module Net end -end; end; end + end + end +end |