source: other-projects/hathitrust/vagrant-solr-cluster/trunk/modules/stdlib/spec/functions/union_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.8 KB
Line 
1require 'spec_helper'
2
3describe 'union' do
4 describe 'argument checking' do
5 it { is_expected.not_to eq(nil) }
6 it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
7 it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
8 it { is_expected.to run.with_params('one', []).and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
9 it { is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
10 it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
11 end
12
13 it { is_expected.to run.with_params([], []).and_return([]) }
14 it { is_expected.to run.with_params([], ['one']).and_return(['one']) }
15 it { is_expected.to run.with_params(['one'], []).and_return(['one']) }
16 it { is_expected.to run.with_params(['one'], ['one']).and_return(['one']) }
17 it { is_expected.to run.with_params(['one'], ['two']).and_return(['one', 'two']) }
18 it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'three']).and_return(['one', 'two', 'three']) }
19 it { is_expected.to run.with_params(['one', 'two', 'two', 'three'], ['two', 'three']).and_return(['one', 'two', 'three']) }
20 it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'two', 'three']).and_return(['one', 'two', 'three']) }
21 it { is_expected.to run.with_params(['one', 'two'], ['two', 'three'], ['one', 'three']).and_return(['one', 'two', 'three']) }
22 it { is_expected.to run.with_params(['one', 'two'], ['three', 'four'], ['one', 'two', 'three'], ['four']).and_return(['one', 'two', 'three', 'four']) }
23 it 'should not confuse types' do is_expected.to run.with_params(['1', '2', '3'], [1, 2]).and_return(['1', '2', '3', 1, 2]) end
24end
Note: See TracBrowser for help on using the repository browser.