1 require 'spec_helper_acceptance'
3 describe 'size function', :if => Puppet::Util::Package.versioncmp(return_puppet_version, '6.0.0') < 0 do
8 notice(inline_template('size is <%= @o.inspect %>'))
10 it 'single string size' do
11 apply_manifest(pp1, :catch_failures => true) do |r|
12 expect(r.stdout).to match(%r{size is 14})
19 notice(inline_template('size is <%= @o.inspect %>'))
21 it 'with empty string' do
22 apply_manifest(pp2, :catch_failures => true) do |r|
23 expect(r.stdout).to match(%r{size is 0})
30 notice(inline_template('size is <%= @o.inspect %>'))
33 apply_manifest(pp3, :catch_failures => true) do |r|
34 expect(r.stdout).to match(%r{size is 0})
39 $a = ['discombobulate', 'moo']
41 notice(inline_template('size is <%= @o.inspect %>'))
43 it 'strings in array' do
44 apply_manifest(pp4, :catch_failures => true) do |r|
45 expect(r.stdout).to match(%r{size is 2})
50 it 'handles no arguments'
51 it 'handles non strings or arrays'