Sha256: db480a4a2bf5c7e9ad2b6107f5d87224e505e7edd4ed42f8b56e7032825a65cc

Contents?: true

Size: 659 Bytes

Versions: 6

Compression:

Stored size: 659 Bytes

Contents

#! /usr/bin/env ruby -S rspec
require 'spec_helper_acceptance'

describe 'deep_merge function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
  describe 'success' do
    it 'should deep merge two hashes' do
      pp = <<-EOS
      $hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
      $hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
      $merged_hash = deep_merge($hash1, $hash2)

      if $merged_hash != { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } } {
        fail("Hash was incorrectly merged.")
      }
      EOS

      apply_manifest(pp, :catch_failures => true)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
puppet-retrospec-0.12.1 spec/fixtures/modules/stdlib/spec/acceptance/deep_merge_spec.rb
puppet-retrospec-0.12.0 spec/fixtures/modules/stdlib/spec/acceptance/deep_merge_spec.rb
puppet-retrospec-0.11.0 spec/fixtures/modules/stdlib/spec/acceptance/deep_merge_spec.rb
puppet-retrospec-0.10.0 spec/fixtures/modules/stdlib/spec/acceptance/deep_merge_spec.rb
puppet-retrospec-0.9.1 spec/fixtures/modules/stdlib/spec/acceptance/deep_merge_spec.rb
puppet-retrospec-0.9.0 spec/fixtures/modules/stdlib/spec/acceptance/deep_merge_spec.rb