source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/concat_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: 1.3 KB
Line 
1require 'spec_helper'
2
3describe 'concat' do
4 it { is_expected.not_to eq(nil) }
5 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError) }
6 it { is_expected.to run.with_params([1]).and_raise_error(Puppet::ParseError) }
7 it { is_expected.to run.with_params(1, [2]).and_raise_error(Puppet::ParseError) }
8 it { is_expected.to run.with_params([1], [2], [3]).and_return([1, 2, 3]) }
9 it { is_expected.to run.with_params(['1','2','3'],['4','5','6']).and_return(['1','2','3','4','5','6']) }
10 it { is_expected.to run.with_params(['1','2','3'],'4').and_return(['1','2','3','4']) }
11 it { is_expected.to run.with_params(['1','2','3'],[['4','5'],'6']).and_return(['1','2','3',['4','5'],'6']) }
12 it { is_expected.to run.with_params(['1','2'],['3','4'],['5','6']).and_return(['1','2','3','4','5','6']) }
13 it { is_expected.to run.with_params(['1','2'],'3','4',['5','6']).and_return(['1','2','3','4','5','6']) }
14 it { is_expected.to run.with_params([{"a" => "b"}], {"c" => "d", "e" => "f"}).and_return([{"a" => "b"}, {"c" => "d", "e" => "f"}]) }
15
16 it "should leave the original array intact" do
17 argument1 = ['1','2','3']
18 original1 = argument1.dup
19 argument2 = ['4','5','6']
20 original2 = argument2.dup
21 result = subject.call([argument1,argument2])
22 expect(argument1).to eq(original1)
23 expect(argument2).to eq(original2)
24 end
25end
Note: See TracBrowser for help on using the repository browser.