diff options
Diffstat (limited to 'test/ruby/test_hash.rb')
-rw-r--r-- | test/ruby/test_hash.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 4f48d3b90c..cb59524bd0 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -1333,6 +1333,16 @@ class TestHash < Test::Unit::TestCase assert_not_operator(h2, :>, h2) end + def test_to_proc + h = { + 1 => 10, + 2 => 20, + 3 => 30, + } + + assert_equal([10, 20, 30], [1, 2, 3].map(&h)) + end + class TestSubHash < TestHash class SubHash < Hash def reject(*) |