1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62931 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
eregon 2018-03-26 20:48:21 +00:00
parent 6c2b589865
commit 9245e097ec
7 changed files with 108 additions and 64 deletions

View file

@ -61,21 +61,21 @@ ruby_version_is "2.5" do
end
# https://bugs.ruby-lang.org/issues/14380
ruby_version_is ""..."2.6" do
ruby_version_is ""..."2.5.1" do
it "does not prevent conflicts between new keys and old ones" do
@hash.transform_keys!(&:succ)
@hash.should == { e: 1 }
end
end
ruby_version_is "2.6" do
ruby_version_is "2.5.1" do
it "prevents conflicts between new keys and old ones" do
@hash.transform_keys!(&:succ)
@hash.should == { b: 1, c: 2, d: 3, e: 4 }
end
end
ruby_version_is ""..."2.6" do
ruby_version_is ""..."2.5.1" do
it "partially modifies the contents if we broke from the block" do
@hash.transform_keys! do |v|
break if v == :c
@ -85,7 +85,7 @@ ruby_version_is "2.5" do
end
end
ruby_version_is "2.6" do
ruby_version_is "2.5.1" do
it "returns the processed keys if we broke from the block" do
@hash.transform_keys! do |v|
break if v == :c