Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / member_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'member function' do
4   shared_examples 'item found' do
5     it 'outputs correctly' do
6       apply_manifest(pp, :catch_failures => true) do |r|
7         expect(r.stdout).to match(%r{Notice: output correct})
8       end
9     end
10   end
11   describe 'success' do
12     pp1 = <<-DOC
13       $a = ['aaa','bbb','ccc']
14       $b = 'ccc'
15       $c = true
16       $o = member($a,$b)
17       if $o == $c {
18         notify { 'output correct': }
19       }
20     DOC
21     it 'members arrays' do
22       apply_manifest(pp1, :catch_failures => true) do |r|
23         expect(r.stdout).to match(%r{Notice: output correct})
24       end
25     end
26
27     describe 'members array of integers' do
28       let(:pp) do
29         <<-DOC
30             if member( [1,2,3,4], 4 ){
31               notify { 'output correct': }
32             }
33         DOC
34       end
35
36       it_behaves_like 'item found' do
37       end
38     end
39     describe 'members of mixed array' do
40       let(:pp) do
41         <<-DOC
42             if member( ['a','4',3], 'a' ){
43               notify { 'output correct': }
44             }
45         DOC
46       end
47
48       it_behaves_like 'item found' do
49       end
50     end
51     it 'members arrays without members'
52   end
53
54   describe 'failure' do
55     it 'handles improper argument counts'
56   end
57 end