Skip to content

Commit

Permalink
Merge pull request #74 from kachick/improve/remove_warnings
Browse files Browse the repository at this point in the history
Remove a warning "shadowing outer local variable - type"
  • Loading branch information
delano committed Jan 11, 2013
2 parents fe568aa + b39e38e commit 9abfc1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/net/ssh/test/local_packet.rb
Expand Up @@ -33,17 +33,17 @@ def process(packet)
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
Expand Down

0 comments on commit 9abfc1c

Please sign in to comment.