diff options
Diffstat (limited to 'test/ruby/test_hash.rb')
-rw-r--r-- | test/ruby/test_hash.rb | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/test/ruby/test_hash.rb b/test/ruby/test_hash.rb index 9c2978cd8a..4c4dea84b7 100644 --- a/test/ruby/test_hash.rb +++ b/test/ruby/test_hash.rb @@ -671,6 +671,9 @@ class TestHash < Test::Unit::TestCase assert_equal({1=>2, 3=>4}, Hash[[[1,2],[3,4]]]) assert_raise(ArgumentError) { Hash[0, 1, 2] } assert_equal({1=>2, 3=>4}, Hash[1,2,3,4]) + o = Object.new + def o.to_hash() {1=>2} end + assert_equal({1=>2}, Hash[o], "[ruby-dev:34555]") end def test_rehash2 |