1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'deep_merge function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'should deep merge two hashes' do
8 $hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
9 $hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
10 $merged_hash = deep_merge($hash1, $hash2)
12 if $merged_hash != { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } } {
13 fail("Hash was incorrectly merged.")
17 apply_manifest(pp, :catch_failures => true)