Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / is_hash_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'is_hash function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $a = ['aaa','bbb','ccc']
7       $o = is_hash($a)
8       notice(inline_template('is_hash is <%= @o.inspect %>'))
9     DOC
10     it 'is_hashs arrays' do
11       apply_manifest(pp1, :catch_failures => true) do |r|
12         expect(r.stdout).to match(%r{is_hash is false})
13       end
14     end
15
16     pp2 = <<-DOC
17       $a = {}
18       $b = true
19       $o = is_hash($a)
20       if $o == $b {
21         notify { 'output correct': }
22       }
23     DOC
24     it 'is_hashs empty hashs' do
25       apply_manifest(pp2, :catch_failures => true) do |r|
26         expect(r.stdout).to match(%r{Notice: output correct})
27       end
28     end
29
30     pp3 = <<-DOC
31       $a = "aoeu"
32       $b = false
33       $o = is_hash($a)
34       if $o == $b {
35         notify { 'output correct': }
36       }
37     DOC
38     it 'is_hashs strings' do
39       apply_manifest(pp3, :catch_failures => true) do |r|
40         expect(r.stdout).to match(%r{Notice: output correct})
41       end
42     end
43
44     pp4 = <<-DOC
45       $a = {'aaa'=>'bbb'}
46       $b = true
47       $o = is_hash($a)
48       if $o == $b {
49         notify { 'output correct': }
50       }
51     DOC
52     it 'is_hashs hashes' do
53       apply_manifest(pp4, :catch_failures => true) do |r|
54         expect(r.stdout).to match(%r{Notice: output correct})
55       end
56     end
57   end
58   describe 'failure' do
59     it 'handles improper argument counts'
60   end
61 end