1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'merge function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'should merge two hashes' do
8 $a = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
9 $b = {'two' => 'dos', 'three' => { 'five' => 5 } }
11 notice(inline_template('merge[one] is <%= @o["one"].inspect %>'))
12 notice(inline_template('merge[two] is <%= @o["two"].inspect %>'))
13 notice(inline_template('merge[three] is <%= @o["three"].inspect %>'))
16 apply_manifest(pp, :catch_failures => true) do |r|
17 expect(r.stdout).to match(/merge\[one\] is ("1"|1)/)
18 expect(r.stdout).to match(/merge\[two\] is "dos"/)
19 expect(r.stdout).to match(/merge\[three\] is {"five"=>("5"|5)}/)