diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 09:52:36 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 09:52:36 +0000 |
commit | 975c414b91224ec7144451982a4433a5442be6fc (patch) | |
tree | d78e9ee580e2f49bcae9775d43cf2532de244f2c /test/ruby/test_array.rb | |
parent | 2b988c36bea29718b1518c0c486891634db039d4 (diff) |
object.c: raise TypeError
* object.c (rb_obj_dig): raise TypeError if an element does not
have #dig method. [ruby-core:71798] [Bug #11762]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53058 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_array.rb')
-rw-r--r-- | test/ruby/test_array.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/ruby/test_array.rb b/test/ruby/test_array.rb index 0922cb4c65..d2af339a11 100644 --- a/test/ruby/test_array.rb +++ b/test/ruby/test_array.rb @@ -2654,7 +2654,8 @@ class TestArray < Test::Unit::TestCase def test_dig h = @cls[@cls[{a: 1}], 0] assert_equal(1, h.dig(0, 0, :a)) - assert_nil(h.dig(1, 0)) + assert_nil(h.dig(2, 0)) + assert_raise(TypeError) {h.dig(1, 0)} end private |