Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / is_array_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'is_array function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $a = ['aaa','bbb','ccc']
7       $b = true
8       $o = is_array($a)
9       if $o == $b {
10         notify { 'output correct': }
11       }
12     DOC
13     it 'is_arrays 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 = []
21       $b = true
22       $o = is_array($a)
23       if $o == $b {
24         notify { 'output correct': }
25       }
26     DOC
27     it 'is_arrays empty arrays' 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 = "aoeu"
35       $b = false
36       $o = is_array($a)
37       if $o == $b {
38         notify { 'output correct': }
39       }
40     DOC
41     it 'is_arrays strings' 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 = {'aaa'=>'bbb'}
49       $b = false
50       $o = is_array($a)
51       if $o == $b {
52         notify { 'output correct': }
53       }
54     DOC
55     it 'is_arrays hashes' 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   end
61   describe 'failure' do
62     it 'handles improper argument counts'
63     it 'handles non-arrays'
64   end
65 end