3 describe 'sort', :if => Puppet::Util::Package.versioncmp(Puppet.version, '6.0.0') < 0 do
4 describe 'signature validation' do
5 it { is_expected.not_to eq(nil) }
6 it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
7 it { is_expected.to run.with_params([], 'extra').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
9 pending('stricter input checking')
10 is_expected.to run.with_params({}).and_raise_error(Puppet::ParseError, %r{requires string or array})
13 pending('stricter input checking')
14 is_expected.to run.with_params(1).and_raise_error(Puppet::ParseError, %r{requires string or array})
17 pending('stricter input checking')
18 is_expected.to run.with_params(true).and_raise_error(Puppet::ParseError, %r{requires string or array})
22 context 'when called with an array' do
23 it { is_expected.to run.with_params([]).and_return([]) }
24 it { is_expected.to run.with_params(['a']).and_return(['a']) }
25 it { is_expected.to run.with_params(['c', 'b', 'a']).and_return(['a', 'b', 'c']) }
28 context 'when called with a string' do
29 it { is_expected.to run.with_params('').and_return('') }
30 it { is_expected.to run.with_params('a').and_return('a') }
31 it { is_expected.to run.with_params('cbda').and_return('abcd') }