Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / validate_string_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'validate_string function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $one = 'string'
7       validate_string($one)
8     DOC
9     it 'validates a single argument' do
10       apply_manifest(pp1, :catch_failures => true)
11     end
12
13     pp2 = <<-DOC
14       $one = 'string'
15       $two = 'also string'
16       validate_string($one,$two)
17     DOC
18     it 'validates an multiple arguments' do
19       apply_manifest(pp2, :catch_failures => true)
20     end
21
22     pp3 = <<-DOC
23       validate_string(undef)
24     DOC
25     it 'validates undef' do
26       apply_manifest(pp3, :catch_failures => true)
27     end
28
29     {
30       %{validate_string({ 'a' => 'hash' })} => 'Hash',
31       %{validate_string(['array'])}         => 'Array',
32       %{validate_string(false)}             => 'FalseClass',
33     }.each do |pp4, type|
34       it "validates a non-string: #{pp4.inspect}" do
35         expect(apply_manifest(pp4, :expect_failures => true).stderr).to match(%r{a #{type}})
36       end
37     end
38   end
39   describe 'failure' do
40     it 'handles improper number of arguments'
41   end
42 end