Sha256: 570cd341814626587dc6b058ea1bac8ba75a2a3a6671c64079da15edfe882f7c

Contents?: true

Size: 393 Bytes

Versions: 6

Compression:

Stored size: 393 Bytes

Contents

# frozen_string_literal: true

describe LokaliseManager::Utils::HashUtils do
  using described_class
  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

6 entries across 6 versions & 1 rubygems

Version Path
lokalise_manager-2.2.1 spec/lib/utils/hash_utils_spec.rb
lokalise_manager-3.0.0 spec/lib/lokalise_manager/utils/hash_utils_spec.rb
lokalise_manager-2.2.0 spec/lib/utils/hash_utils_spec.rb
lokalise_manager-2.1.0 spec/lib/utils/hash_utils_spec.rb
lokalise_manager-2.0.0 spec/lib/utils/hash_utils_spec.rb
lokalise_manager-1.2.1 spec/lib/utils/hash_utils_spec.rb