RUBY-265 fix OrderedHash#reject!
This commit is contained in:
parent
9c30de332f
commit
d0a4483713
|
@ -138,6 +138,10 @@ module BSON
|
|||
clone.delete_if(&block)
|
||||
end
|
||||
|
||||
def reject!(&block)
|
||||
delete_if(&block)
|
||||
end
|
||||
|
||||
def clear
|
||||
super
|
||||
@ordered_keys = []
|
||||
|
|
|
@ -187,6 +187,11 @@ class OrderedHashTest < Test::Unit::TestCase
|
|||
assert !new.keys.include?('z')
|
||||
end
|
||||
|
||||
def test_reject_bang
|
||||
@oh.reject! { |k, v| k == 'z' }
|
||||
assert !@ok.keys.include?('z')
|
||||
end
|
||||
|
||||
def test_clone
|
||||
copy = @oh.clone
|
||||
assert copy.keys == @oh.keys
|
||||
|
|
Loading…
Reference in New Issue