Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / capitalize_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'capitalize function', :if => Puppet::Util::Package.versioncmp(return_puppet_version, '6.0.0') < 0 do
4   describe 'success' do
5     pp1 = <<-DOC
6         $input = 'this is a string'
7         $output = capitalize($input)
8         notify { $output: }
9     DOC
10     it 'capitalizes the first letter of a string' do
11       apply_manifest(pp1, :catch_failures => true) do |r|
12         expect(r.stdout).to match(%r{Notice: This is a string})
13       end
14     end
15
16     pp2 = <<-DOC
17       $input = ['this', 'is', 'a', 'string']
18       $output = capitalize($input)
19       notify { $output: }
20     DOC
21     regex_array = [%r{Notice: This}, %r{Notice: Is}, %r{Notice: A}, %r{Notice: String}]
22     it 'capitalizes the first letter of an array of strings' do
23       apply_manifest(pp2, :catch_failures => true) do |r|
24         regex_array.each do |i|
25           expect(r.stdout).to match(i)
26         end
27       end
28     end
29   end
30 end