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