deep_merge_spec.rb 550 B

123456789101112131415161718
  1. require 'spec_helper_acceptance'
  2. describe 'deep_merge function' do
  3. describe 'success' do
  4. pp = <<-DOC
  5. $hash1 = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
  6. $hash2 = {'two' => 'dos', 'three' => { 'five' => 5 } }
  7. $merged_hash = deep_merge($hash1, $hash2)
  8. if $merged_hash != { 'one' => 1, 'two' => 'dos', 'three' => { 'four' => 4, 'five' => 5 } } {
  9. fail("Hash was incorrectly merged.")
  10. }
  11. DOC
  12. it 'deeps merge two hashes' do
  13. apply_manifest(pp, :catch_failures => true)
  14. end
  15. end
  16. end