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