OrderedHash#each returns self not ordered_keys
This commit is contained in:
parent
79e76be9df
commit
454bb440e4
@ -67,6 +67,7 @@ class OrderedHash < Hash
|
||||
def each
|
||||
@ordered_keys ||= []
|
||||
@ordered_keys.each { |k| yield k, self[k] }
|
||||
self
|
||||
end
|
||||
|
||||
def values
|
||||
|
@ -72,6 +72,8 @@ class OrderedHashTest < Test::Unit::TestCase
|
||||
|
||||
@oh['z'] = 42
|
||||
assert_equal keys, @oh.keys
|
||||
|
||||
assert_equal @oh, @oh.each {|k,v|}
|
||||
end
|
||||
|
||||
def test_values
|
||||
|
Loading…
Reference in New Issue
Block a user