diff options
author | Delano Mandelbaum <delano.mandelbaum@gmail.com> | 2013-01-11 09:07:07 -0800 |
---|---|---|
committer | Delano Mandelbaum <delano.mandelbaum@gmail.com> | 2013-01-11 09:07:07 -0800 |
commit | 9abfc1c92731f3f0b31ad50914786d27423227ea (patch) | |
tree | 4eb7ac4f2fd5e6745daaf53a1af535f0ef83fb3a | |
parent | fe568aa17310b6a8423c19cc1e6f89bf03846ff9 (diff) | |
parent | b39e38e16fd922cbba8965decd366bb660344fcf (diff) | |
download | net-ssh-9abfc1c92731f3f0b31ad50914786d27423227ea.tar.gz |
Merge pull request #74 from kachick/improve/remove_warnings
Remove a warning "shadowing outer local variable - type"
-rw-r--r-- | lib/net/ssh/test/local_packet.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/net/ssh/test/local_packet.rb b/lib/net/ssh/test/local_packet.rb index 3909d21..ac2e3d4 100644 --- a/lib/net/ssh/test/local_packet.rb +++ b/lib/net/ssh/test/local_packet.rb @@ -33,17 +33,17 @@ module Net; module SSH; module Test type = packet.read_byte raise "expected #{@type}, but got #{type}" if @type != type - @data.zip(types).each do |expected, type| - type ||= case expected + @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 - actual = packet.send("read_#{type}") + actual = packet.send("read_#{_type}") next if expected.nil? - raise "expected #{type} #{expected.inspect} but got #{actual.inspect}" unless expected == actual + raise "expected #{_type} #{expected.inspect} but got #{actual.inspect}" unless expected == actual end end end |