3 describe 'shell_split' do
4 it { is_expected.not_to eq(nil) }
6 describe 'signature validation' do
7 it { is_expected.to run.with_params.and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
8 it { is_expected.to run.with_params('foo', 'bar').and_raise_error(Puppet::ParseError, %r{wrong number of arguments}i) }
11 describe 'stringification' do
12 it { is_expected.to run.with_params(10).and_return(['10']) }
13 it { is_expected.to run.with_params(false).and_return(['false']) }
16 describe 'shell line spliting' do
17 it { is_expected.to run.with_params('foo').and_return(['foo']) }
18 it { is_expected.to run.with_params('foo bar').and_return(['foo', 'bar']) }
20 is_expected.to run.with_params('\~\`\!@\#\$\%\^\&\*\(\)_\+-\=\[\]\\\\\{\}\|\;\\\':\",./\<\>\?')
21 .and_return(['~`!@#$%^&*()_+-=[]\{}|;\':",./<>?'])
24 is_expected.to run.with_params('\~\`\!@\#\$ \%\^\&\*\(\)_\+-\= \[\]\\\\\{\}\|\;\\\':\" ,./\<\>\?')
25 .and_return(['~`!@#$', '%^&*()_+-=', '[]\{}|;\':"', ',./<>?'])
28 context 'with UTF8 and double byte characters' do
29 it { is_expected.to run.with_params('\\μ\\ť\\ƒ 8 \\ŧ\\ĕ\\χ\\ť').and_return(['μťƒ', '8', 'ŧĕχť']) }
30 it { is_expected.to run.with_params('\\ス\\ペ\\ー \\ス\\を\\含\\む\\テ \\ \\キ\\ス\\ト').and_return(['スペー', 'スを含むテ', ' キスト']) }