Sha256: 6f275955df889e915048ce04d1a6a78dd6103e219fc2acfde833bede2193583f
Contents?: true
Size: 322 Bytes
Versions: 6
Compression:
Stored size: 322 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
6 entries across 6 versions & 1 rubygems