Sha256: 9355475d94a56d9ab151412c8e0899063329c12f0d8269e5d2c089fe7e293a95
Contents?: true
Size: 325 Bytes
Versions: 10
Compression:
Stored size: 325 Bytes
Contents
require_relative '../../test_helper' DuckPuncher.punch! :Object class HashTest < MiniTest::Test def test_dig my_hash = { a: 1, b: { c: 2 } }.punch assert_equal my_hash.dig(:a), 1 assert_equal my_hash.dig(:b, :a), nil assert_equal my_hash.dig(:b, :c), 2 assert_equal my_hash.dig(:b), { c: 2 } end end
Version data entries
10 entries across 10 versions & 1 rubygems