Sha256: 5e35e965cc7d0bf7be1826dcb24735bfc9a0a6d0fbe957ca73f9bd93c8595fe6

Contents?: true

Size: 658 Bytes

Versions: 33

Compression:

Stored size: 658 Bytes

Contents

require 'spec_helper'

describe Lev::Utilities do

  it "should merge properly" do
    default_options = {
      translations: {
        outputs: {
          scope: :blah
        }
      }
    }

    options = {
      translations: {
        inputs: {
          type: :verbatim
        },
        outputs: {
          map: {foo: :bar}
        }
      }
    }

    expected = {
      translations: {
        outputs: {
          scope: :blah,
          map: {foo: :bar}
        },
        inputs: {
          type: :verbatim
        }
      }
    }

    merged = Lev::Utilities.deep_merge(default_options, options)
    expect(merged).to eq expected
  end

end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
lev-4.0.0 spec/deep_merge_spec.rb
lev-3.0.0 spec/deep_merge_spec.rb
lev-2.2.1 spec/deep_merge_spec.rb
lev-2.2.0 spec/deep_merge_spec.rb
lev-2.1.1 spec/deep_merge_spec.rb
lev-2.1.0 spec/deep_merge_spec.rb
lev-2.0.5 spec/deep_merge_spec.rb
lev-2.0.4 spec/deep_merge_spec.rb
lev-2.0.3 spec/deep_merge_spec.rb
lev-2.0.2 spec/deep_merge_spec.rb
lev-2.0.1 spec/deep_merge_spec.rb
lev-1.0.1 spec/deep_merge_spec.rb
lev-1.0.0 spec/deep_merge_spec.rb