From 13d8bb03859255049dd10046a0a1a24352ec8110 Mon Sep 17 00:00:00 2001 From: marcandre Date: Sat, 12 Dec 2015 21:40:50 +0000 Subject: * 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 --- test/ostruct/test_ostruct.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'test/ostruct/test_ostruct.rb') 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 -- cgit v1.2.3