Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / has_key_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'has_key function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $a = { 'aaa' => 'bbb','bbb' => 'ccc','ddd' => 'eee' }
7       $b = 'bbb'
8       $c = true
9       $o = has_key($a,$b)
10       if $o == $c {
11         notify { 'output correct': }
12       }
13     DOC
14     it 'has_keys in hashes' do
15       apply_manifest(pp1, :catch_failures => true) do |r|
16         expect(r.stdout).to match(%r{Notice: output correct})
17       end
18     end
19
20     pp2 = <<-DOC
21       $a = { 'aaa' => 'bbb','bbb' => 'ccc','ddd' => 'eee' }
22       $b = 'ccc'
23       $c = false
24       $o = has_key($a,$b)
25       if $o == $c {
26         notify { 'output correct': }
27       }
28     DOC
29     it 'has_keys not in hashes' do
30       apply_manifest(pp2, :catch_failures => true) do |r|
31         expect(r.stdout).to match(%r{Notice: output correct})
32       end
33     end
34   end
35   describe 'failure' do
36     it 'handles improper argument counts'
37     it 'handles non-hashes'
38   end
39 end