diff options
author | Kenichi Kamiya <kachick1@gmail.com> | 2013-01-11 21:54:56 +0900 |
---|---|---|
committer | Kenichi Kamiya <kachick1@gmail.com> | 2013-01-11 21:54:56 +0900 |
commit | b39e38e16fd922cbba8965decd366bb660344fcf (patch) | |
tree | 93c74e8df80cd356f84243eeeaea55e32d348b47 | |
parent | 01ccaf5e296260a0aa48da6029e8d69335a5f52c (diff) | |
download | net-ssh-b39e38e16fd922cbba8965decd366bb660344fcf.tar.gz |
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 |