summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-hash-ext
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-03-23 12:34:32 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-03-23 12:34:32 +0900
commit817b884343cc349d3c32da7f1c65cb4867963bde (patch)
tree49ffcd28618ed32c94c393dfa9367daae02a6249 /mrbgems/mruby-hash-ext
parentdaf83946bbf2834da8393cd50af2bc7bcee3289f (diff)
downloadmruby-817b884343cc349d3c32da7f1c65cb4867963bde.tar.gz
mruby-817b884343cc349d3c32da7f1c65cb4867963bde.zip
add #dig tests
Diffstat (limited to 'mrbgems/mruby-hash-ext')
-rw-r--r--mrbgems/mruby-hash-ext/test/hash.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/mrbgems/mruby-hash-ext/test/hash.rb b/mrbgems/mruby-hash-ext/test/hash.rb
index 8b6b2e5b9..b43541b7f 100644
--- a/mrbgems/mruby-hash-ext/test/hash.rb
+++ b/mrbgems/mruby-hash-ext/test/hash.rb
@@ -236,3 +236,9 @@ assert('Hash#>') do
assert_false(h2 > h1)
assert_false(h2 > h2)
end
+
+assert("Hash#dig") do
+ h = {a:{b:{c:1}}}
+ assert_equal(1, h.dig(:a, :b, :c))
+ assert_nil(h.dig(:d))
+end