Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / bool2num_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'bool2num function' do
4   describe 'success' do
5     ['false', 'f', '0', 'n', 'no'].each do |bool|
6       pp1 = <<-DOC
7         $input = "#{bool}"
8         $output = bool2num($input)
9         notify { "$output": }
10       DOC
11       it "should convert a given boolean, #{bool}, to 0" do
12         apply_manifest(pp1, :catch_failures => true) do |r|
13           expect(r.stdout).to match(%r{Notice: 0})
14         end
15       end
16     end
17
18     ['true', 't', '1', 'y', 'yes'].each do |bool|
19       pp2 = <<-DOC
20         $input = "#{bool}"
21         $output = bool2num($input)
22         notify { "$output": }
23       DOC
24       it "should convert a given boolean, #{bool}, to 1" do
25         apply_manifest(pp2, :catch_failures => true) do |r|
26           expect(r.stdout).to match(%r{Notice: 1})
27         end
28       end
29     end
30   end
31 end