Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / validate_bool_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'validate_bool function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       $one = true
7       validate_bool($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 = true
15       $two = false
16       validate_bool($one,$two)
17     DOC
18     it 'validates an multiple arguments' do
19       apply_manifest(pp2, :catch_failures => true)
20     end
21     [
22       %{validate_bool('true')},
23       %{validate_bool('false')},
24       %{validate_bool([true])},
25       %{validate_bool(undef)},
26     ].each do |pp3|
27       it "rejects #{pp3.inspect}" do
28         expect(apply_manifest(pp3, :expect_failures => true).stderr).to match(%r{is not a boolean\.  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