Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / suffix_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'suffix function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $o = suffix(['a','b','c'],'p')
7       notice(inline_template('suffix is <%= @o.inspect %>'))
8     DOC
9     it 'suffixes array of values' do
10       apply_manifest(pp1, :catch_failures => true) do |r|
11         expect(r.stdout).to match(%r{suffix is \["ap", "bp", "cp"\]})
12       end
13     end
14
15     pp2 = <<-DOC
16       $o = suffix([],'p')
17       notice(inline_template('suffix is <%= @o.inspect %>'))
18     DOC
19     it 'suffixs with empty array' do
20       apply_manifest(pp2, :catch_failures => true) do |r|
21         expect(r.stdout).to match(%r{suffix is \[\]})
22       end
23     end
24
25     pp3 = <<-DOC
26       $o = suffix(['a','b','c'], undef)
27       notice(inline_template('suffix is <%= @o.inspect %>'))
28     DOC
29     it 'suffixs array of values with undef' do
30       apply_manifest(pp3, :catch_failures => true) do |r|
31         expect(r.stdout).to match(%r{suffix is \["a", "b", "c"\]})
32       end
33     end
34   end
35   describe 'failure' do
36     it 'fails with no arguments'
37     it 'fails when first argument is not array'
38     it 'fails when second argument is not string'
39   end
40 end