1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
4 describe 'concat function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
6 it 'should concat one array to another' do
8 $output = concat(['1','2','3'],['4','5','6'])
9 validate_array($output)
10 if size($output) != 6 {
11 fail("${output} should have 6 elements.")
15 apply_manifest(pp, :catch_failures => true)
17 it 'should concat arrays and primitives to array' do
19 $output = concat(['1','2','3'],'4','5','6',['7','8','9'])
20 validate_array($output)
21 if size($output) != 9 {
22 fail("${output} should have 9 elements.")
26 apply_manifest(pp, :catch_failures => true)
28 it 'should concat multiple arrays to one' do
30 $output = concat(['1','2','3'],['4','5','6'],['7','8','9'])
31 validate_array($output)
32 if size($output) != 9 {
33 fail("${output} should have 9 elements.")
37 apply_manifest(pp, :catch_failures => true)