Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / validate_slength_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'validate_slength function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $one = 'discombobulate'
7       $two = 17
8       validate_slength($one,$two)
9     DOC
10     it 'validates a single string max' do
11       apply_manifest(pp1, :catch_failures => true)
12     end
13
14     pp2 = <<-DOC
15       $one = ['discombobulate', 'moo']
16       $two = 17
17       validate_slength($one,$two)
18     DOC
19     it 'validates multiple string maxes' do
20       apply_manifest(pp2, :catch_failures => true)
21     end
22
23     pp3 = <<-DOC
24       $one = ['discombobulate', 'moo']
25       $two = 17
26       $three = 3
27       validate_slength($one,$two,$three)
28     DOC
29     it 'validates min/max of  strings in array' do
30       apply_manifest(pp3, :catch_failures => true)
31     end
32
33     pp4 = <<-DOC
34       $one = 'discombobulate'
35       $two = 1
36       validate_slength($one,$two)
37     DOC
38     it 'validates a single string max of incorrect length' do
39       apply_manifest(pp4, :expect_failures => true)
40     end
41
42     pp5 = <<-DOC
43       $one = ['discombobulate', 'moo']
44       $two = 3
45       validate_slength($one,$two)
46     DOC
47     it 'validates multiple string maxes of incorrect length' do
48       apply_manifest(pp5, :expect_failures => true)
49     end
50
51     pp6 = <<-DOC
52       $one = ['discombobulate', 'moo']
53       $two = 17
54       $three = 10
55       validate_slength($one,$two,$three)
56     DOC
57     it 'validates multiple strings min/maxes of incorrect length' do
58       apply_manifest(pp6, :expect_failures => true)
59     end
60   end
61   describe 'failure' do
62     it 'handles improper number of arguments'
63     it 'handles improper first argument type'
64     it 'handles non-strings in array of first argument'
65     it 'handles improper second argument type'
66     it 'handles improper third argument type'
67     it 'handles negative ranges'
68     it 'handles improper ranges'
69   end
70 end