summaryrefslogtreecommitdiff
path: root/spec/functions
diff options
context:
space:
mode:
authorDavid Schmitt <david.schmitt@puppetlabs.com>2015-08-24 14:36:20 +0100
committerDavid Schmitt <david.schmitt@puppetlabs.com>2015-08-24 14:36:20 +0100
commit24e57b5d2849982d5a927f43d698ff7f312ab93a (patch)
tree315a8a912f1bd8d17530b84bdb923b45596cae3d /spec/functions
parent1d89df906e1ae1d09a862974181663caaf8012c6 (diff)
parent1d9189d860f28067b72093cbe4027cf49b7d612c (diff)
downloadpuppet-stdlib-24e57b5d2849982d5a927f43d698ff7f312ab93a.tar.gz
puppet-stdlib-24e57b5d2849982d5a927f43d698ff7f312ab93a.tar.bz2
Merge pull request #507 from Jetroid/mod2456
(MODULES-2456) Modify union to accept more than two arrays
Diffstat (limited to 'spec/functions')
-rwxr-xr-xspec/functions/union_spec.rb9
1 files changed, 5 insertions, 4 deletions
diff --git a/spec/functions/union_spec.rb b/spec/functions/union_spec.rb
index 970e1fe..cfd38b6 100755
--- a/spec/functions/union_spec.rb
+++ b/spec/functions/union_spec.rb
@@ -5,10 +5,9 @@ describe 'union' do
it { is_expected.not_to eq(nil) }
it { is_expected.to run.with_params().and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
it { is_expected.to run.with_params('one').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
- it { is_expected.to run.with_params('one', 'two', 'three').and_raise_error(Puppet::ParseError, /wrong number of arguments/i) }
- it { is_expected.to run.with_params('one', []).and_raise_error(Puppet::ParseError, /Requires 2 arrays/) }
- it { is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError, /Requires 2 arrays/) }
- it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError, /Requires 2 arrays/) }
+ it { is_expected.to run.with_params('one', []).and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
+ it { is_expected.to run.with_params([], 'two').and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
+ it { is_expected.to run.with_params({}, {}).and_raise_error(Puppet::ParseError, /Every parameter must be an array/) }
end
it { is_expected.to run.with_params([], []).and_return([]) }
@@ -19,5 +18,7 @@ describe 'union' do
it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'three']).and_return(['one', 'two', 'three']) }
it { is_expected.to run.with_params(['one', 'two', 'two', 'three'], ['two', 'three']).and_return(['one', 'two', 'three']) }
it { is_expected.to run.with_params(['one', 'two', 'three'], ['two', 'two', 'three']).and_return(['one', 'two', 'three']) }
+ it { is_expected.to run.with_params(['one', 'two'], ['two', 'three'], ['one', 'three']).and_return(['one', 'two', 'three']) }
+ it { is_expected.to run.with_params(['one', 'two'], ['three', 'four'], ['one', 'two', 'three'], ['four']).and_return(['one', 'two', 'three', 'four']) }
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
end