]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/stdlib/spec/acceptance/deep_merge_spec.rb
upgrade to stdlib 4.6.1
[dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / deep_merge_spec.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
3
4 describe 'deep_merge function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5   describe 'success' do
6     it 'should deep merge two hashes' do
7       pp = <<-EOS
8       $hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
9       $hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
10       $merged_hash = deep_merge($hash1, $hash2)
11
12       if $merged_hash != { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } } {
13         fail("Hash was incorrectly merged.")
14       }
15       EOS
16
17       apply_manifest(pp, :catch_failures => true)
18     end
19   end
20 end