1 require 'spec_helper_acceptance'
3 describe 'prefix function' do
6 $o = prefix(['a','b','c'],'p')
7 notice(inline_template('prefix is <%= @o.inspect %>'))
9 it 'prefixes array of values' do
10 apply_manifest(pp1, :catch_failures => true) do |r|
11 expect(r.stdout).to match(%r{prefix is \["pa", "pb", "pc"\]})
17 notice(inline_template('prefix is <%= @o.inspect %>'))
19 it 'prefixs with empty array' do
20 apply_manifest(pp2, :catch_failures => true) do |r|
21 expect(r.stdout).to match(%r{prefix is \[\]})
26 $o = prefix(['a','b','c'], undef)
27 notice(inline_template('prefix is <%= @o.inspect %>'))
29 it 'prefixs array of values with undef' do
30 apply_manifest(pp3, :catch_failures => true) do |r|
31 expect(r.stdout).to match(%r{prefix is \["a", "b", "c"\]})
36 it 'fails with no arguments'
37 it 'fails when first argument is not array'
38 it 'fails when second argument is not string'