Sha256: 41be988d500bad067bab3903aee3d80e7860b14a30676b577e83ac6648333fcd
Contents?: true
Size: 589 Bytes
Versions: 12
Compression:
Stored size: 589 Bytes
Contents
describe Dap::Utils::Misc do describe '.flatten_hash' do context 'with mixed nested data' do let(:test_hash) { {"foo0": "bar0", "foo1": {"bar1": "stuff", "more": 1}, "foo2": {"bar2": "stuff", "more": 1, "morestuff": {"foo1": "thing1"}}} } let(:expected_flat) { {'foo0'=>'bar0', 'foo1.bar1'=>'stuff', 'foo1.more'=>'1', 'foo2.bar2'=>'stuff', 'foo2.more'=>'1', 'foo2.morestuff.foo1'=>'thing1'} } let(:actual_flat) { Dap::Utils::Misc.flatten_hash(test_hash) } it 'flattens properly' do expect(actual_flat).to eq(expected_flat) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems