1 require 'spec_helper_acceptance'
3 describe 'concat function' do
6 $output = concat(['1','2','3'],['4','5','6'])
7 validate_array($output)
8 if size($output) != 6 {
9 fail("${output} should have 6 elements.")
12 it 'concats one array to another' do
13 apply_manifest(pp1, :catch_failures => true)
17 $output = concat(['1','2','3'],'4','5','6',['7','8','9'])
18 validate_array($output)
19 if size($output) != 9 {
20 fail("${output} should have 9 elements.")
23 it 'concats arrays and primitives to array' do
24 apply_manifest(pp2, :catch_failures => true)
28 $output = concat(['1','2','3'],['4','5','6'],['7','8','9'])
29 validate_array($output)
30 if size($output) != 9 {
31 fail("${output} should have 9 elements.")
34 it 'concats multiple arrays to one' do
35 apply_manifest(pp3, :catch_failures => true)
39 $output = concat([{"a" => "b"}], {"c" => "d", "e" => "f"})
40 validate_array($output)
41 if size($output) != 2 {
42 fail("${output} should have 2 elements.")
44 if $output[1] != {"c" => "d", "e" => "f"} {
45 fail("${output} does not have the expected hash for the second element.")
48 it 'concats hash arguments' do
49 apply_manifest(pp4, :catch_failures => true)