Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / values_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'values function', :if => Puppet::Util::Package.versioncmp(Puppet.version, '5.5.0') < 0 do
4   describe 'success' do
5     pp1 = <<-DOC
6       $arg = {
7         'a' => 1,
8         'b' => 2,
9         'c' => 3,
10       }
11       $output = values($arg)
12       notice(inline_template('<%= @output.sort.inspect %>'))
13     DOC
14     it 'returns an array of values' do
15       expect(apply_manifest(pp1, :catch_failures => true).stdout).to match(%r{\[1, 2, 3\]})
16     end
17   end
18
19   describe 'failure' do
20     pp2 = <<-DOC
21       $arg = "foo"
22       $output = values($arg)
23       notice(inline_template('<%= @output.inspect %>'))
24     DOC
25     it 'handles non-hash arguments' do
26       expect(apply_manifest(pp2, :expect_failures => true).stderr).to match(%r{Requires hash})
27     end
28   end
29 end