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