From eaa0a27f6149a9afa2b29729307ff9cc7b0bc95f Mon Sep 17 00:00:00 2001 From: mrkn Date: Thu, 8 Sep 2016 02:33:18 +0000 Subject: hash.c: map_v -> transform_values * hash.c (rb_hash_transform_values, rb_hash_transform_values_bang): Rename map_v to transform_values. [Feature #12512] [ruby-core:76095] * test/ruby/test_hash.rb: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_hash.rb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'test/ruby') diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 2b2f154803..edc0eeebee 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -1415,24 +1415,24 @@ class TestHash < Test::Unit::TestCase assert_equal([10, 20, 30], [1, 2, 3].map(&h)) end - def test_map_v + def test_transform_values x = @cls[a: 1, b: 2, c: 3] - y = x.map_v {|v| v ** 2 } + y = x.transform_values {|v| v ** 2 } assert_equal([1, 4, 9], y.values_at(:a, :b, :c)) assert_not_same(x, y) - y = x.map_v.with_index {|v, i| "#{v}.#{i}" } + y = x.transform_values.with_index {|v, i| "#{v}.#{i}" } assert_equal(%w(1.0 2.1 3.2), y.values_at(:a, :b, :c)) end - def test_map_v_bang + def test_transform_values_bang x = @cls[a: 1, b: 2, c: 3] - y = x.map_v! {|v| v ** 2 } + y = x.transform_values! {|v| v ** 2 } assert_equal([1, 4, 9], y.values_at(:a, :b, :c)) assert_same(x, y) x = @cls[a: 1, b: 2, c: 3] - y = x.map_v!.with_index {|v, i| "#{v}.#{i}" } + y = x.transform_values!.with_index {|v, i| "#{v}.#{i}" } assert_equal(%w(1.0 2.1 3.2), y.values_at(:a, :b, :c)) end -- cgit v1.2.3