Sha256: b6c9dc52710eac862c546f42f43abd1b24cc83ebcfe9c7de5964ad851077de28

Contents?: true

Size: 551 Bytes

Versions: 192

Compression:

Stored size: 551 Bytes

Contents

#! /usr/bin/env ruby
require 'spec_helper'
require 'puppet/pops'

module Puppet::Pops
describe 'MergeStrategy' do
  context 'deep merge' do
    it 'does not mutate the source of a merge' do
      a = { 'a' => { 'b' => 'va' }, 'c' => 2 }
      b = { 'a' => { 'b' => 'vb' }, 'b' => 3}
      c = MergeStrategy.strategy(:deep).merge(a, b);
      expect(a).to eql({ 'a' => { 'b' => 'va' }, 'c' => 2 })
      expect(b).to eql({ 'a' => { 'b' => 'vb' }, 'b' => 3 })
      expect(c).to eql({ 'a' => { 'b' => 'va' }, 'b' => 3, 'c' => 2 })
    end
  end
end
end

Version data entries

192 entries across 192 versions & 1 rubygems

Version Path
puppet-6.4.0 spec/unit/pops/merge_strategy_spec.rb
puppet-6.4.0-x86-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-6.4.0-x64-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-6.4.0-universal-darwin spec/unit/pops/merge_strategy_spec.rb
puppet-6.0.7 spec/unit/pops/merge_strategy_spec.rb
puppet-6.0.7-x86-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-6.0.7-x64-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-6.0.7-universal-darwin spec/unit/pops/merge_strategy_spec.rb
puppet-5.5.12 spec/unit/pops/merge_strategy_spec.rb
puppet-5.5.12-x86-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-5.5.12-x64-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-5.5.12-universal-darwin spec/unit/pops/merge_strategy_spec.rb
puppet-6.3.0 spec/unit/pops/merge_strategy_spec.rb
puppet-6.3.0-x86-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-6.3.0-x64-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-6.3.0-universal-darwin spec/unit/pops/merge_strategy_spec.rb
puppet-6.2.0 spec/unit/pops/merge_strategy_spec.rb
puppet-6.2.0-x86-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-6.2.0-x64-mingw32 spec/unit/pops/merge_strategy_spec.rb
puppet-6.2.0-universal-darwin spec/unit/pops/merge_strategy_spec.rb