Suggest different variables to use if we want to tunnel both v4 and v6
[mirror/dsa-puppet.git] / 3rdparty / modules / stdlib / spec / acceptance / squeeze_spec.rb
1 require 'spec_helper_acceptance'
2
3 describe 'squeeze function' do
4   describe 'success' do
5     pp1 = <<-DOC
6       # Real words!
7       $a = ["wallless", "laparohysterosalpingooophorectomy", "brrr", "goddessship"]
8       $o = squeeze($a)
9       notice(inline_template('squeeze is <%= @o.inspect %>'))
10     DOC
11     it 'squeezes arrays' do
12       apply_manifest(pp1, :catch_failures => true) do |r|
13         expect(r.stdout).to match(%r{squeeze is \["wales", "laparohysterosalpingophorectomy", "br", "godeship"\]})
14       end
15     end
16
17     it 'squeezez arrays with an argument'
18     pp2 = <<-DOC
19       $a = "wallless laparohysterosalpingooophorectomy brrr goddessship"
20       $o = squeeze($a)
21       notice(inline_template('squeeze is <%= @o.inspect %>'))
22     DOC
23     it 'squeezes strings' do
24       apply_manifest(pp2, :catch_failures => true) do |r|
25         expect(r.stdout).to match(%r{squeeze is "wales laparohysterosalpingophorectomy br godeship"})
26       end
27     end
28
29     pp3 = <<-DOC
30       $a = "countessship duchessship governessship hostessship"
31       $o = squeeze($a, 's')
32       notice(inline_template('squeeze is <%= @o.inspect %>'))
33     DOC
34     it 'squeezes strings with an argument' do
35       apply_manifest(pp3, :catch_failures => true) do |r|
36         expect(r.stdout).to match(%r{squeeze is "counteship ducheship governeship hosteship"})
37       end
38     end
39   end
40   describe 'failure' do
41     it 'handles no arguments'
42     it 'handles non strings or arrays'
43   end
44 end