source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/acceptance/merge_spec.rb@ 30960

Last change on this file since 30960 was 30960, checked in by davidb, 7 years ago

Switch to using Puppet to provision machine. Strongly based on files developed for spark-hdfs cluster

  • Property svn:executable set to *
File size: 903 bytes
Line 
1#! /usr/bin/env ruby -S rspec
2require 'spec_helper_acceptance'
3
4describe 'merge function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5 describe 'success' do
6 it 'should merge two hashes' do
7 pp = <<-EOS
8 $a = {'one' => 1, 'two' => 2, 'three' => { 'four' => 4 } }
9 $b = {'two' => 'dos', 'three' => { 'five' => 5 } }
10 $o = merge($a, $b)
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 %>'))
14 EOS
15
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)}/)
20 end
21 end
22 end
23end
Note: See TracBrowser for help on using the repository browser.