Sha256: 4515b123a2235d5147f11cfc3044e58f0120c49d12d132076bcb0c0722cafbad

Contents?: true

Size: 339 Bytes

Versions: 1

Compression:

Stored size: 339 Bytes

Contents

# frozen_string_literal: true

describe Hash do
  let(:h1) { {a: 100, b: 200, c: {c1: 100}} }
  let(:h2) { {b: 250, c: {c1: 200}} }

  specify '#deep_merge' do
    result = h1.deep_merge(h2) { |_key, this_val, other_val| this_val + other_val }
    expect(result[:b]).to eq(450)
    expect(result[:c][:c1]).to eq(300)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
lokalise_manager-1.2.0 spec/lib/ext/hash_spec.rb