diff options
author | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 21:40:50 +0000 |
---|---|---|
committer | marcandre <marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-12-12 21:40:50 +0000 |
commit | 13d8bb03859255049dd10046a0a1a24352ec8110 (patch) | |
tree | 69b6080f22c9ac2891427cfe1159e65ffa1ad38d /test | |
parent | 96c4fa0b0905e6f587fcacfa8acd2e384057aeb5 (diff) | |
download | ruby-13d8bb03859255049dd10046a0a1a24352ec8110.tar.gz |
* lib/ostruct.rb: Have OpenStruct#dig raise if argument is not a symbol
nor a string. See [#11762]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53063 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ostruct/test_ostruct.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/test/ostruct/test_ostruct.rb b/test/ostruct/test_ostruct.rb index d8d4cd30f0..b098992bc9 100644 --- a/test/ostruct/test_ostruct.rb +++ b/test/ostruct/test_ostruct.rb @@ -116,7 +116,7 @@ class TC_OpenStruct < Test::Unit::TestCase os2.child = [42] assert_equal :bar, os1.dig("child", :foo) assert_nil os1.dig("parent", :foo) - assert_nil os1.dig("child", 0) + assert_raise(TypeError) { os1.dig("child", 0) } end def test_to_h |