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