ruby-changes:49926
From: mrkn <ko1@a...>
Date: Fri, 26 Jan 2018 11:01:53 +0900 (JST)
Subject: [ruby-changes:49926] mrkn:r62044 (trunk): Fix rubyspec against the change in Hash#transform_keys!
mrkn 2018-01-26 11:01:47 +0900 (Fri, 26 Jan 2018) New Revision: 62044 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62044 Log: Fix rubyspec against the change in Hash#transform_keys! [Bug #14380] [ruby-core:84951] Modified files: trunk/spec/ruby/core/hash/transform_keys_spec.rb Index: spec/ruby/core/hash/transform_keys_spec.rb =================================================================== --- spec/ruby/core/hash/transform_keys_spec.rb (revision 62043) +++ spec/ruby/core/hash/transform_keys_spec.rb (revision 62044) @@ -60,9 +60,9 @@ ruby_version_is "2.5" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/transform_keys_spec.rb#L60 @hash.should == { 'a' => 1, 'b' => 2, 'c' => 3, 'd' => 4 } 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.should == { e: 1 } + @hash.should == { b: 1, c: 2, d: 3, e: 4 } end it "partially modifies the contents if we broke from the block" do @@ -70,7 +70,7 @@ ruby_version_is "2.5" do https://github.com/ruby/ruby/blob/trunk/spec/ruby/core/hash/transform_keys_spec.rb#L70 break if v == :c v.succ end - @hash.should == { c: 1, d: 4 } + @hash.should == { b: 1, c: 2 } end it "keeps later pair if new keys conflict" do -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/