4 if Puppet.version.to_f < 5.0
5 describe 'signature validation' do
6 it { is_expected.not_to eq(nil) }
7 it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
9 pending('Current implementation ignores parameters after the first.')
10 is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i)
12 it { is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, %r{Requires either array or string to work}) }
13 it { is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, %r{Requires either array or string to work}) }
14 it { is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, %r{Requires either array or string to work}) }
17 context 'when called with an array' do
18 it { is_expected.to run.with_params([]).and_return([]) }
19 it { is_expected.to run.with_params(['a']).and_return(['a']) }
20 it { is_expected.to run.with_params(['a', 'b', 'a']).and_return(['a', 'b']) }
21 it { is_expected.to run.with_params(['ã', 'ъ', 'ã']).and_return(['ã', 'ъ']) }
24 context 'when called with a string' do
25 it { is_expected.to run.with_params('').and_return('') }
26 it { is_expected.to run.with_params('a').and_return('a') }
27 it { is_expected.to run.with_params('aaba').and_return('ab') }
28 it { is_expected.to run.with_params('ããъã').and_return('ãъ') }