Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / validate_hash_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'validate_hash function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $one = { 'a' => 1 }
7       validate_hash($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 = { 'a' => 1 }
15       $two = { 'b' => 2 }
16       validate_hash($one,$two)
17     DOC
18     it 'validates an multiple arguments' do
19       apply_manifest(pp2, :catch_failures => true)
20     end
21
22     [
23       %{validate_hash('{ "not" => "hash" }')},
24       %{validate_hash('string')},
25       %{validate_hash(["array"])},
26       %{validate_hash(undef)},
27     ].each do |pp3|
28       it "rejects #{pp3.inspect}" do
29         expect(apply_manifest(pp3, :expect_failures => true).stderr).to match(%r{})
30       end
31     end
32   end
33   describe 'failure' do
34     it 'handles improper number of arguments'
35   end
36 end