]> git.donarmstrong.com Git - dsa-puppet.git/blob - 3rdparty/modules/stdlib/spec/acceptance/concat_spec.rb
upgrade to stdlib 4.6.1
[dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / concat_spec.rb
1 #! /usr/bin/env ruby -S rspec
2 require 'spec_helper_acceptance'
3
4 describe 'concat function', :unless => UNSUPPORTED_PLATFORMS.include?(fact('operatingsystem')) do
5   describe 'success' do
6     it 'should concat one array to another' do
7       pp = <<-EOS
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.")
12       }
13       EOS
14
15       apply_manifest(pp, :catch_failures => true)
16     end
17     it 'should concat arrays and primitives to array' do
18       pp = <<-EOS
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.")
23       }
24       EOS
25
26       apply_manifest(pp, :catch_failures => true)
27     end
28     it 'should concat multiple arrays to one' do
29       pp = <<-EOS
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.")
34       }
35       EOS
36
37       apply_manifest(pp, :catch_failures => true)
38     end
39   end
40 end