Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / clamp_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'clamp function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $x = 17
7       $y = 225
8       $z = 155
9       $o = clamp($x, $y, $z)
10       if $o == $z {
11         notify { 'output correct': }
12       }
13     DOC
14     it 'clamps list of values' 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 = [7, 19, 66]
22       $b = 19
23       $o = clamp($a)
24       if $o == $b {
25         notify { 'output correct': }
26       }
27     DOC
28     it 'clamps array of values' do
29       apply_manifest(pp2, :catch_failures => true) do |r|
30         expect(r.stdout).to match(%r{Notice: output correct})
31       end
32     end
33   end
34   describe 'failure' do
35     it 'handles improper argument counts'
36     it 'handles no arguments'
37   end
38 end