Fix rubyspec against the change in Hash#transform_keys!
[Bug #14380] [ruby-core:84951] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62044 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
e7c62ca767
commit
9c7caa3be5
@ -60,9 +60,9 @@ ruby_version_is "2.5" do
|
|||||||
@hash.should == { 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4 }
|
@hash.should == { 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4 }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "does not prevent conflicts between new keys and old ones" do
|
it "prevents conflicts between new keys and old ones" do
|
||||||
@hash.transform_keys!(&:succ)
|
@hash.transform_keys!(&:succ)
|
||||||
@hash.should == { e: 1 }
|
@hash.should == { b: 1, c: 2, d: 3, e: 4 }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "partially modifies the contents if we broke from the block" do
|
it "partially modifies the contents if we broke from the block" do
|
||||||
@ -70,7 +70,7 @@ ruby_version_is "2.5" do
|
|||||||
break if v == :c
|
break if v == :c
|
||||||
v.succ
|
v.succ
|
||||||
end
|
end
|
||||||
@hash.should == { c: 1, d: 4 }
|
@hash.should == { b: 1, c: 2 }
|
||||||
end
|
end
|
||||||
|
|
||||||
it "keeps later pair if new keys conflict" do
|
it "keeps later pair if new keys conflict" do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user