Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / validate_re_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'validate_re function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $one = 'one'
7       $two = '^one$'
8       validate_re($one,$two)
9     DOC
10     it 'validates a string' do
11       apply_manifest(pp1, :catch_failures => true)
12     end
13
14     pp2 = <<-DOC
15       $one = 'one'
16       $two = ['^one$', '^two']
17       validate_re($one,$two)
18     DOC
19     it 'validates an array' do
20       apply_manifest(pp2, :catch_failures => true)
21     end
22
23     pp3 = <<-DOC
24       $one = 'one'
25       $two = ['^two$', '^three']
26       validate_re($one,$two)
27     DOC
28     it 'validates a failed array' do
29       apply_manifest(pp3, :expect_failures => true)
30     end
31
32     pp4 = <<-DOC
33       $one = '3.4.3'
34       $two = '^2.7'
35       validate_re($one,$two,"The $puppetversion fact does not match 2.7")
36     DOC
37     it 'validates a failed array with a custom error message' do
38       expect(apply_manifest(pp4, :expect_failures => true).stderr).to match(%r{does not match})
39     end
40   end
41
42   describe 'failure' do
43     it 'handles improper number of arguments'
44     it 'handles improper argument types'
45   end
46 end