Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / count_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'count function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $input = [1,2,3,4]
7       $output = count($input)
8       notify { "$output": }
9     DOC
10     it 'counts elements in an array' do
11       apply_manifest(pp1, :catch_failures => true) do |r|
12         expect(r.stdout).to match(%r{Notice: 4})
13       end
14     end
15
16     pp2 = <<-DOC
17       $input = [1,1,1,2]
18       $output = count($input, 1)
19       notify { "$output": }
20     DOC
21     it 'counts elements in an array that match a second argument' do
22       apply_manifest(pp2, :catch_failures => true) do |r|
23         expect(r.stdout).to match(%r{Notice: 3})
24       end
25     end
26   end
27 end